首页 > 其他 > 详细

history命令添加日志和用户

时间:2020-03-29 19:51:51      阅读:40      评论:0      收藏:0      [点我收藏+]
echo ‘export HISTTIMEFORMAT="%F %T `whoami` "‘ >> /etc/profile

技术分享图片

source /etc/profile

查询如下:

 578  2020-03-29 19:08:14 root whoami
  579  2020-03-29 19:13:31 root history
  580  2020-03-29 19:15:18 root vim /etc/profile
  581  2020-03-29 19:16:00 root source /etc/profile
  582  2020-03-29 19:16:04 root ls
  583  2020-03-29 19:16:06 root ll
  584  2020-03-29 19:16:10 root history
  585  2020-03-29 19:16:33 root  vim /etc/profile
  586  2020-03-29 19:19:55 root passwd st
  587  2020-03-29 19:20:05 root useradd st
  588  2020-03-29 19:20:10 root passwd st
  589  2020-03-29 19:21:20 root history
  590  2020-03-29 19:22:06 root reboot
  591  2020-03-29 19:23:00 root history
  592  2020-03-29 19:23:08 root su - st
  593  2020-03-29 19:23:23 root history
[root@iZ1la3d1xbmukrZ ~]#

 

history命令添加日志和用户

原文:https://www.cnblogs.com/dalianpai/p/12594206.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!