linux下查询history操作时间的方法

番茄系统家园 · 2022-09-03 12:23:19

要在linux操作系统中查看history记录的操作时间,可以按如下步骤实现:
1,修改/etc/profile文件,在末尾添加:export histtimeformat=”%f %t `whoami` ”

2,或在用户目录下,修改文件 .bash_profile,添加export histtimeformat=”%f %t `whoami` ”

退出终端,重新登录。

例,查看history操作时间:

复制代码代码如下:
[root@jb51 ~]$ history | tail
9892013-06-24 19:06:04 admin vi .bash_profile
9902013-06-24 22:06:03 admin ll
9912013-06-24 22:06:09 admin vi .bash_profile
9922013-06-24 22:06:18 admin ll -ag
9932013-06-24 22:06:55 admin history | tail
9942013-06-24 22:07:11 admin vi .bash_profile
9952013-06-24 22:07:24 admin history | tail
9962013-06-24 22:07:32 admin eixt
9972013-06-24 22:07:35 admin exit
9982013-06-24 22:07:41 admin history | tail

免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/xtwt/169750yJM9uI.html
猜你喜欢
最新应用
热门应用