zl程序教程

您现在的位置是:首页 >  系统

当前栏目

linux histroy显示时间

Linux 时间 显示
2023-09-11 14:21:08 时间

转自:https://www.jianshu.com/p/57b9f285d325

大家在linux系统里面肯定经常使用history来查看历史命令,但是,一般的history命令只显示了命令,并没有显示命令的时间。如下图所示

 
  
 

我们执行

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

 

之后,然后source /etc/profile。history命令就可以显示时间。

 
  


作者:Winston_e8b2
链接:https://www.jianshu.com/p/57b9f285d325
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。