Fork me on GitHub

Linux history记录添加命令执行时间、用户、IP

在/etc/profile最后添加以下命令:

 export HISTTIMEFORMAT="%F %T `who am i | awk '{ print $1 $5 }'` "

  

 

 

清除本次会话history:

history -r

 

posted @ 2021-07-15 16:29  星拂晓空  阅读(197)  评论(0编辑  收藏  举报