设置很简单:
4 ./startup.sh
5 ./shutdown.sh
6 ps -ef
7 ./startup.sh
8 ls
9 cd /home
10 ls
11 cd mnt
12 cd /mnt
13 ls
14 ls /usr/local/tomcat-server/
15 cd /usr/local/tomcat-server/
16 ls
17 cd logs/
18 ls
19 cd ..
20 cd ./
21 cd ../
22 ls
23 cd ./
24 cd /jome
25 cd ./home
26 cd home
27 cd /home
28 cd ..
29 ls
[root@web01 /]# export HISTTIMEFORMAT="%F %T `whoami` "
[root@web01 /]# echo 'export HISTTIMEFORMAT="%F %T `whoami` "' >> /etc/profile
**************************************
965 2013-10-18 10:32:34 root cd ..
966 2013-10-18 10:32:34 root ls
967 2013-10-18 10:32:34 root hostname -d
968 2013-10-18 10:32:34 root hostname -f
969 2013-10-18 10:32:34 root ipconfig
970 2013-10-18 10:32:34 root iwconfig
971 2013-10-18 10:32:34 root ls
972 2013-10-18 10:32:34 root ls
973 2013-10-18 10:32:34 root cd ..
974 2013-10-18 10:32:34 root ls
975 2013-10-18 10:32:34 root cd usr/local/tomcat-server/
976 2013-10-18 10:32:34 root ls
977 2013-10-18 10:32:34 root cd logs/
978 2013-10-18 10:32:34 root ls
979 2013-10-18 10:32:34 root tail -f catalina.out
980 2013-10-18 10:32:34 root cd ../
981 2013-10-18 10:32:34 root cd /usr/local
982 2013-10-18 10:32:34 root ls
983 2013-10-18 10:32:34 root cd tomcat-server/
984 2013-10-18 10:32:34 root cd logs
985 2013-10-18 10:32:34 root ls
986 2013-10-18 10:32:34 root tail -f catalina.out
987 2013-10-18 10:32:34 root ping 192.168.5.210
988 2013-10-18 10:32:34 root cd ..
989 2013-10-18 10:32:34 root ls
990 2013-10-18 10:32:34 root exit
991 2013-10-18 10:32:34 root ls
992 2013-10-18 10:32:34 root cd
993 2013-10-18 10:32:34 root ls
994 2013-10-18 10:32:34 root cd ..
995 2013-10-18 10:32:34 root ls
996 2013-10-18 10:32:34 root cd usr/local/tomcat-server/
997 2013-10-18 10:32:34 root sl
998 2013-10-18 10:32:34 root ls
999 2013-10-18 10:32:35 root cd ..
1000 2013-10-18 10:32:36 root lks
1001 2013-10-18 10:32:37 root ls
1002 2013-10-18 10:33:15 root histroy
1003 2013-10-18 10:33:24 root history
1004 2013-10-18 10:40:23 root export HISTTIMEFORMAT="%F %T `whoami` "
1005 2013-10-18 10:40:34 root echo 'export HISTTIMEFORMAT="%F %T `whoami` "' >> /etc/profile
1006 2013-10-18 10:40:36 root history
HISTTIMEFORMAT 的格式就是 strftime 函数的格式,比如上面的 "%F %T",%F 表示显示出 Y-M-D 格式的日期,%T 表示显示出 H-M-S 这样格式的时间。