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

时间:2014-09-02 12:30:14   收藏:0   阅读:234

显示历史命令之行时间

这里的环境是centos5.8 


vim  ~/.bashrc 或者 ~/.bash_profile
增加

export HISTTIMEFORMAT="%F %T  "


一次会话的话先执行
export HISTTIMEFORMAT="%F %T  "
然后使用history 命令就行了

# history 500|grep get_charge_by_month
 1002  2014-09-02 10:17:34  history -500|grep get_charge_by_month
 1005  2014-09-02 10:26:41  history 500|grep get_charge_by_month

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




评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!