外包公司和我们公司都在服务器上 所以想给history加上这个记录 好方便查看操作记录
- vim /etc/profile 加上如下语句
- export HISTTIMEFORMAT=`whoami`" : %Y %h/%d - %H:%M:%S "
- source /etc/profile
- 然后查看效果
- [root@nagios perl]# hisotry
- 1042 root : 2012 Mar/12 - 15:55:46 history
- 1044 root : 2012 Mar/12 - 15:56:03 ls
- 1045 root : 2012 Mar/12 - 15:56:05 history
- 1046 root : 2012 Mar/12 - 16:04:30 history | less
- 1047 root : 2012 Mar/12 - 16:04:42 history
转载于:https://blog.51cto.com/liveforlinux/803766