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

vi ~/.profile

增加

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

然后  source ~/.profile 

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

posted @ 2021-06-18 15:50  李照耀  阅读(65)  评论(0编辑  收藏  举报