history命令,显示历史操作记录.但默认不显示操作记录的时间戮,如下:
history
998 history
999 vi .bashrc
1000 history
1001 history
如何显示操作记录的时间戮:
解决办法:配置环境变量:
export HISTTIMEFORMAT="%F %T "
重新登录后:
history
998 2010-12-03 17:26:56 history
999 2010-12-03 17:26:56 vi .bashrc
1000 2010-12-03 17:26:56 history
1001 2010-12-03 17:26:58 history
1002 2010-12-03 17:27:43 vi .bashrc
也要把变量配置加入到~/.bash_profile 或者~/.bashrc文件中,这样重新登录后就会自动增加显示时间戮功能。
"%F %T"为时间格示,详细见man strftime