获取oh-my-zsh“历史记录”以显示命令日期和时间

时间:2018-10-11 08:34:19

标签: oh-my-zsh

.zshrc有以下几行:

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

但是取消注释并运行history无效。

2 个答案:

答案 0 :(得分:1)

.zshrc注释文本具有误导性。

使用:

HIST_STAMPS="%d/%m/%y %T"

分别显示日,月,年和时间。

答案 1 :(得分:0)

我正在使用omz运行zsh 5.7.1(x86_64-apple-darwin19.0)。

HIST_STAMPS =“ mm / dd / yyyy” 现在可以正常使用了。

相关问题