history结果显示执行时间

未配置前

[root@localhost ~]# history | grep mysql
  169  kubectl get pods -n deepflow|grep mysql
  998  history | grep mysql

配置

echo 'export HISTTIMEFORMAT="%F %T "' >> /etc/profile
source /etc/profile

配置后

[root@localhost ~]# history | grep mysql
  169  2022-06-13 16:21:14kubectl get pods -n deepflow|grep mysql
  998  2022-06-13 16:21:17history | grep mysql
 1000  2022-06-13 16:26:32history | grep mysql

本文链接:

http://blog.ps-ef.cn/CentOS/159.html
1 + 3 =
快来做第一个评论的人吧~