在/etc/profile最后一行里添加内容
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
然后重新加载文件
source /etc/profile
最后查看效果,执行history