例子,linux下history命令显示时间记录不规律。
复制代码代码示例:
tail ~/.bashrc
(责任编辑:IT)export HISTTIMEFORMAT="%F %T " 1 2014-05-16 20:20:42 ls /backup/mysql/ 2 2014-05-16 17:32:17 cd /backup/mysql/ 3 2014-05-16 17:32:17 ls 4 2014-05-16 17:32:20 ll -h 5 2014-05-16 17:32:34 sz bbs_20140516.dmp.gz 6 2014-05-16 17:33:07 ls 7 2014-05-16 17:31:02 ls 8 2014-05-16 17:31:02 clear 9 2014-05-16 17:31:03 ls 10 2014-05-16 17:31:04 pwd 11 2014-05-16 17:31:05 clear 12 2014-05-16 17:31:05 ls 13 2014-05-16 17:33:31 sz bbs.sql 14 2014-05-16 17:35:17 ls 15 2014-05-16 17:35:20 xz www.tar 16 2014-05-16 17:35:26 sz www.tar 17 2014-05-16 17:35:34 ls 18 2014-05-16 17:35:43 sz www_com.sql 19 2014-05-16 17:36:11 ls 20 2014-05-16 17:36:16 gzip www_com.sql 21 2014-05-16 17:37:44 ls 22 2014-05-16 17:37:49 sz www*.sql.gz 23 2014-05-16 17:44:51 ls 24 2014-05-16 17:44:53 ls *.gz 25 2014-05-16 17:45:05 rm www_com.sql.gz 26 2014-05-16 17:45:08 ls 27 2014-05-16 17:45:09 clear 28 2014-05-16 17:45:09 ls 29 2014-05-16 17:46:08 which sz 30 2014-05-16 17:35:56 ls 31 2014-05-16 17:36:02 gzip www.tar 32 2014-05-16 17:39:27 ls 33 2014-05-16 17:39:33 sz www.tar.gz 34 2014-05-16 18:05:53 ls 35 2014-05-16 18:05:55 rm *.gz 36 2014-05-16 18:05:57 ls 37 2014-05-16 18:06:02 rm -rf *.tar.gz 38 2014-05-16 18:06:03 ls 39 2014-05-16 18:06:04 exit 40 2014-05-16 18:23:48 history 41 2014-05-16 18:23:53 passwd 42 2014-05-16 18:52:13 history 43 2014-05-16 18:55:56 ls /backup/mysql/ 44 2014-05-16 18:56:19 last -10 45 2014-05-16 19:10:10 history 46 2014-05-16 18:55:35 ll 47 2014-05-16 18:55:37 cd /var/log/ 48 2014-05-16 18:55:38 ll 49 2014-05-16 18:55:57 more secure 50 2014-05-16 18:57:57 history |