文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>history 时间显示

history 时间显示

时间:2010-06-18  来源:h_xin8211

################
#
#     思路
#
################

通过增加 HISTTIMEFORMAT 变量可以时间记录历史命令的功能


################
#
#     操作
#
################

1. 在 /etc/profile 里添加如下:
--------------------------------------------
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
--------------------------------------------

2. source 一下 /etc/profile文件


显示如下:
  180  2010-06-18 21:22:20 ls
  181  2010-06-18 21:22:20 vim /etc/ssh/sshd_config
  182  2010-06-18 21:22:20 exit
  183  2010-06-18 21:22:20 ls
  184  2010-06-18 21:22:20 vim /etc/ssh/sshd_config
  185  2010-06-18 21:22:20 ls
  186  2010-06-18 21:22:20 source /etc/ssh/sshd_config
  187  2010-06-18 21:22:20 exit
  188  2010-06-18 21:22:20 vim /etc/ssh/sshd_config
  189  2010-06-18 21:22:20 exit
  190  2010-06-18 21:17:09 vim /etc/profile
  191  2010-06-18 21:19:44 history
  192  2010-06-18 21:19:55 source /etc/profile
  193  2010-06-18 21:19:58 env
  194  2010-06-18 21:20:05 history
  195  2010-06-18 21:20:36 vim /etc/profile
  196  2010-06-18 21:20:59 source /etc/profile
  197  2010-06-18 21:21:02 hisroty
  198  2010-06-18 21:21:05 history
  199  2010-06-18 21:21:29 vim /etc/profile
  200  2010-06-18 21:21:55 history
  201  2010-06-18 21:21:58 source /etc/profile
  202  2010-06-18 21:22:00 history
  203  2010-06-18 21:22:04 source /etc/profile
  204  2010-06-18 21:22:06 history
  205  2010-06-18 21:22:14 exit
  206  2010-06-18 21:22:23 history
  207  2010-06-18 21:22:30 vim /etc/profile
  208  2010-06-18 21:23:03 source /etc/profile
  209  2010-06-18 21:23:06 history
相关阅读 更多 +
排行榜 更多 +
瓢虫少女

瓢虫少女

飞行射击 下载
潜艇鱼雷

潜艇鱼雷

飞行射击 下载
网络掠夺者

网络掠夺者

飞行射击 下载