让 history 命令显示日期和时间

参考

将 HISTTIMEFORMAT 变量加入 /etc/profile 文件中(或者其他 ~/.bashrc),让它对所有用户永久生效(临时生效用export HISTTIMEFORMAT='%F %T ')。

  1. # echo 'HISTTIMEFORMAT="%F %T "' >> /etc/profile

运行下面命令来让文件中的修改生效。

  1. # source /etc/profile

 

posted on 2018-01-20 20:55  寒星12345678999  阅读(196)  评论(0编辑  收藏  举报