在linux日常使用中,可以方便查看history中的哪个用户什么时间发的什么命令。

在 /etc/profile 中 添加
export HISTTIMEFORMAT="%F %T `whoami` "

效果:
1086 2017-07-24 18:51:23 root history
1087 2017-07-24 18:51:59 root vim /etc/profile
1088 2017-07-24 18:52:28 root source /etc/profile
1089 2017-07-24 18:52:31 root history
1090 2017-07-24 18:52:42 root vim /etc/profile
1091 2017-07-24 18:52:55 root source /etc/profile
1092 2017-07-24 18:52:58 root history

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-07
  • 2021-08-28
  • 2021-12-29
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案