码迷,mamicode.com
首页 > 系统相关 > 详细

[Linux]history 显示命令执行的时间

时间:2016-07-21 14:40:13      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

显示历史命令之行时间

这里的环境是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  
技术分享

 

本文出自 “orangleliu笔记本” 博客,请务必保留此出处http://blog.csdn.net/orangleliu/article/details/39002745

[Linux]history 显示命令执行的时间

标签:

原文地址:http://www.cnblogs.com/Ph-one/p/5691495.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!