【问题标题】:Getting oh-my-zsh 'history' to display command date and time获取 oh-my-zsh 'history' 以显示命令日期和时间
【发布时间】:2019-03-16 06:40:37
【问题描述】:

.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 不起作用。

【问题讨论】:

    标签: oh-my-zsh


    【解决方案1】:

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

    用途:

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

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

    【讨论】:

      【解决方案2】:

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

      HIST_STAMPS="mm/dd/yyyy" 现在可以按预期工作了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-08-27
        • 2016-10-24
        • 2020-12-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-11
        • 1970-01-01
        相关资源
        最近更新 更多