转自:https://www.jianshu.com/p/57b9f285d325
大家在linux系统里面肯定经常使用history来查看历史命令,但是,一般的history命令只显示了命令,并没有显示命令的时间。如下图所示
![](http://upload-images.jianshu.io/upload_images/25770881-138ec0f3aced8dc0.png?imageMogr2/auto-orient/strip|imageView2/2/w/930/format/webp)
我们执行
echo 'export HISTTIMEFORMAT="%F %T"' >>/etc/profile source /etc/profile
之后,然后source /etc/profile。history命令就可以显示时间。
![](http://upload-images.jianshu.io/upload_images/25770881-70911e56a0025038.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp)
作者:Winston_e8b2
链接:https://www.jianshu.com/p/57b9f285d325
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。