linux history 想显示历史命令的时间和作者

Posted 李照耀

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux history 想显示历史命令的时间和作者相关的知识,希望对你有一定的参考价值。

vi ~/.profile

增加

HISTTIMEFORMAT="%F %T `whoami` `who am i|awk \'{print $1,$5}\'|sed \'s/ (/@/\'|sed \'s/)//\'`"

然后  source ~/.profile 

再执行history就有时间和作者了

以上是关于linux history 想显示历史命令的时间和作者的主要内容,如果未能解决你的问题,请参考以下文章