linux查看历史操作记录并且显示执行时间

 

vim  ~/.bashrc 或者 ~/.bash_profile  

增加:export HISTTIMEFORMAT="%F %T  "  

查看历史记录之前先执行:

export HISTTIMEFORMAT="%F %T  "  
 
重新打开shell执行history命令

然后使用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  

posted @ 2019-03-14 15:32  低调的小白  阅读(23894)  评论(0编辑  收藏  举报