外包公司和我们公司都在服务器上 所以想给history加上这个记录 好方便查看操作记录

 
  
  1. vim /etc/profile 加上如下语句 
  2. export HISTTIMEFORMAT=`whoami`" : %Y %h/%d - %H:%M:%S " 
  3. source /etc/profile 
  4.  
  5. 然后查看效果 
  6.  
  7. [root@nagios perl]# hisotry 
  8. 1042  root : 2012 Mar/12 - 15:55:46 history 
  9. 1044  root : 2012 Mar/12 - 15:56:03 ls 
  10. 1045  root : 2012 Mar/12 - 15:56:05 history 
  11. 1046  root : 2012 Mar/12 - 16:04:30 history | less 
  12. 1047  root : 2012 Mar/12 - 16:04:42 history