history

history 管理浏览器命令历史和可选的持久终端记录。浏览器在 localStorage 中保存输入的命令。持久历史把命令和安全的文本输出写入 .lil.log.php,使网页终端可在其他页面恢复记录。

系统版本 1.2.3稳定
lil-terminal

概览

history 把浏览器命令历史与可选的跨页面持久终端日志分开管理。

三种不同的已记忆状态

浏览器命令历史、PHP 会话中的最后文本结果和可选持久记录互相独立。只有在跨页面恢复终端输出值得将内容保存到服务器时,才启用持久记录。

语法

lil-terminal
history [-c|-o|-l [on|off|status|clear]]

参考

history

显示带编号的浏览器命令历史

history -c

清除浏览器命令历史

history -o

显示当前会话保存的最后一次终端结果

history -l

显示持久终端记录

history -l on

启用命令与输出的持久记录

history -l off

停用持久记录但不删除现有记录

history -l status

显示持久记录状态

history -l clear

删除持久终端记录

持久化

持久记录默认关闭。使用 history -l on 启用。设置保存在 .lil.keyhistory 命名空间中。.lil.log.php 最多 400 条、1 MiB,拒绝符号链接并采用原子写入。

隐私

输出可能包含项目路径、数据库行或环境值。仅在适合把这些内容存到服务器时启用。密码和隐藏密钥输入不会被记录。

最后一次结果

history -o 显示当前 PHP 会话中保存的最近一次文本结果。history -o > history.log 会把结果追加到文件,加入 -r 则覆盖该文件。此功能不要求启用持久终端记录。

交互式 sandbox 预览

可直接在页面中运行预先准备的示例。结果已预先生成并在浏览器中显示;服务器不会执行任何终端命令。

显示带编号的浏览器命令历史

安装与管理

安装当前兼容版本。完整功能请选择 Base,精简包请选择 Minimum;已安装模块的更新请使用 upgrade。

Base 与 Minimum 是同一当前模块版本的两个包。

Base 包

安装包含本地参考和全部已发布模式的完整包。

install history
Minimum 包

安装精简包。该包不包含本地参考;help <cmd> -i 会打开当前服务器参考。

install history -m
精确公开版本

安装这个确切的已发布版本。

install history -v 1.2.3
检查或升级

让 upgrade 检查兼容性,仅在需要时替换已安装块。

upgrade history
删除模块

删除扩展块,不影响核心和其他模块。

install history -u

示例

示例可复制,但网站不会执行。请先检查路径、权限和破坏性选项。

显示带编号的浏览器命令历史
pwd | cd \sandbox | history
/home/account/public_html

001  pwd
002  cd \sandbox
003  history
显示当前会话保存的最后一次终端结果
history -o
001  help
002  pwd
003  history
显示当前会话保存的最后一次终端结果
history -o > history.log
001  help
002  pwd
003  history
显示当前会话保存的最后一次终端结果
history -o > history.log -r
001  help
002  pwd
003  history
启用命令与输出的持久记录
history -l on
persistent transcript  on
显示持久记录状态
history -l status
persistent transcript  on
file                   .lil.log.php
删除持久终端记录
history -l clear
001  pwd
002  cd sandbox
003  history
清除浏览器命令历史
history -c
browser command history cleared
显示持久终端记录
history -l maybe
?

相关文档

当前公开版本

v1.2.32026-08-14

分离不同历史层

普通 @clear 不再删除持久日志。持久日志只会通过明确的 @history -l clear@clear -H 删除。