Linux——给history命令加上用户和时间

来源:互联网 发布:js 数组 sort 编辑:程序博客网 时间:2024/05/29 03:40

可以在root下输入如下命令

echo 'export HISTTIMEFORMAT="%F %T `whoami` "' >>/etc/profile

执行source生效:

  source /etc/profile

然后在使用history时,就会在前面显示时间和用户了。

0 0