配置HISTTIMEFORMAT=" %F %T "这个环境变量,可在命令记录里显示时间。
[root@CentOS7 ~]#HISTTIMEFORMAT="%F %T "
[root@CentOS7 ~]#history 10
43 2019-11-27 20:37:44 cat env.sh
44 2019-11-27 20:37:44 exit
45 2019-11-27 20:37:44 nano /etc/profile.d/env.sh
46 2019-11-27 20:37:44 exit
47 2019-11-27 20:37:44 nano /etc/profile.d/env.sh
48 2019-11-27 20:37:44 exit
49 2019-11-27 20:37:44 shutdown now
50 2019-11-27 20:37:54 history
51 2019-11-27 20:38:40 HISTTIMEFORMAT="%F %T "
52 2019-11-27 20:38:49 history 10