首页 > 系统服务 > 详细

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

时间:2016-07-21 14:40:08      阅读:284      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!