################
#
# 思路
#
################
通过增加 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
阅读(648) | 评论(1) | 转发(0) |