command-line - 带有时间戳的 zsh 命令行历史记录
问题描述
我正在使用 zsh 4.3.6。我想在命令行历史记录中有时间戳。history -i
总是显示当前时间:
> history -i
498 2020-04-27 14:54 history -i
499 2020-04-27 14:54 cat ~/.zsh_history
500 2020-04-27 14:54 exit
似乎时间戳未存储在$HISTFILE
:
> cat $HISTFILE
ls
zsh --version
history -i
我怎样才能拥有持久的命令行历史时间戳?
谢谢。
解决方案
setopt EXTENDED_HISTORY # puts timestamps in the history
或者
setopt extendedhistory
至~/.zshrc
推荐阅读
- html - 如何从 Angular 的弹性框中的组件中获取元素信息
- java - 使用 Stream 从 int[] 数组中查找奇数
- r - html_nodes 在网站更新后不再提取表行
- c++ - 将全局命名空间中的重载函数声明为模板类的友元
- android - 在主位图的子区域上执行画布绘制的优化方式
- html - 引荐网站是否可以在发布的 html 表单中识别?
- openshift - Openshift - 环境变量被评估为主机名
- iis - 如何在 IIS7、IIS7.5 下同时使用自定义和详细错误模式
- php - 在为新的 wordpress 插件激活创建测试数据时查看值的关联数组
- silverstripe - Silverstripe 安装根文件夹 public