采纳
在CentOS上使用history查看历史使用的CMD记录时,发现没有时间,在当前用户的.bash_profile里面,添加
.bash_profile
export HISTTIMEFORMAT="%F %T `whoami` "
也可直接写到/etc/profile永久生效。
/etc/profile
echo 'HISTTIMEFORMAT="%F %T "' >> /etc/profile
然后执行source .bash_profile即可。
source .bash_profile