历史命令显示时间IP用户

编辑/etc/profile文件,添加一下内容

export HISTTIMEFORMAT=" %F %T `who -u am i 2> /dev/null | awk '{print $NF}' | sed -e 's/[()]//g'` `whoami` "

重新加载该文件

source  /etc/profile
作者:wiki  创建时间:2024-07-19 20:42
最后编辑:wiki  更新时间:2024-08-13 10:12