让linux的history命令显示操作时间
2015-12-14 13:35
681 查看
很多人都会用到history这个命令,这个命令的意思就是列出来当前用户的所有操作(默认如此),但是很多发行版的默认的history是没有用户和操作时间的,这个对于需要查看原来的操作内容的时候就提供了麻烦,man 了下history,发现有个变量是可以设定history这个显示格式的,这个变量就是HISTTIMEFORMAT
只要执行下面命令:
下面的是显示效果:
只要执行下面命令:
export HISTTIMEFORMAT="`whoami` : | %F | %T: | "然后就可以看到带有用户和时间的history了,把这个保存到当前用户的.bash_profile里面,就可以开机自动加载了
下面的是显示效果:
330 root : | 2012-08-24 | 17:47:12: | yum search nfs 331 root : | 2012-08-24 | 17:47:12: | yum install nfs4-acl-tools 332 root : | 2012-08-24 | 17:47:12: | nfsiostat 333 root : | 2012-08-24 | 17:47:12: | nfs4_editfacl 334 root : | 2012-08-24 | 17:47:12: | nfs4_editfacl --help 335 root : | 2012-08-24 | 17:47:12: | man nfs4_editfacl 336 root : | 2012-08-24 | 17:47:12: | nfs4_getfacl 337 root : | 2012-08-24 | 17:47:12: | nfs4_getfacl -h 338 root : | 2012-08-24 | 17:47:12: | nfs4_getfacl -H 339 root : | 2012-08-24 | 17:47:12: | nfs4_getfacl -H 340 root : | 2012-08-24 | 17:47:12: | ls 341 root : | 2012-08-24 | 17:47:12: | ifconfig还不错吧
相关文章推荐
- linux编译boost
- linux用户及权限
- linux limits.conf 配置
- linux limits.conf 配置
- 安裝 CentOS 7 後必做的七件事
- linux sticky
- Linux平台ext4magic数据恢复软件
- Linux 的帐号与群组:有效与初始群组、groups, newgrp
- Linux 的帐号与群组:有效与初始群组、groups, newgrp
- linux ll按时间排序
- Linux 内核是如何构建的
- linux下安装运行负载 LoadrGenerator(详细步骤,完美安装)
- linux中分区、格式化文件系统、挂载
- Centos7.1搭建pyenv环境并安装python 2.7.10
- [转]Linux查看CPU和内存使用情况
- Centos7.1在pyenv环境中安装pyCharm5.0.2
- linux基础(十五)----linux编程基础----linux条件控制语句----case语句
- 逆向CTF (linux)
- linux基础(十五)----linux编程基础----linux条件控制语句----case语句
- linux下的java开发环境