]# vim /etc/profile ...省略,直接在最后一行添加 export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " #退出当前shell,重新进入 ]# history ... 898 2020-07-19 10:23:31 env 899 2020-07-19 10:23:31 vim /etc/profile 900 2020-07-19 10:23:35 history