Linux history显示时间

来源:互联网 发布:无忧seo 编辑:程序博客网 时间:2024/06/07 14:14

转自http://blog.csdn.net/orangleliu/article/details/39002745

显示历史命令之行时间

这里的环境是centos5.8 


[python] view plain copy
print?
  1. vim  ~/.bashrc 或者 ~/.bash_profile  
  2. 增加  
  3.   
  4. export HISTTIMEFORMAT="%F %T  "  
一次会话的话先执行
[python] view plain copy
 print?
  1. export HISTTIMEFORMAT="%F %T  "  
然后使用history 命令就行了

[python] view plain copy
 print?
  1. # history 500|grep get_charge_by_month  
  2.  1002  2014-09-02 10:17:34  history -500|grep get_charge_by_month  
  3.  1005  2014-09-02 10:26:41  history 500|grep get_charge_by_month