linux中history命令显示操作执行的时间配置
2017-04-10 10:27
761 查看
操作系统:RHEL6.5 vim /etc/bashrc 最后面添加如下: #HISTSET HISTFILESIZE=2000 #保存命令的总数默认总数为1000 HISTSIZE=2000 #设置了history命令输出最多的记录总数 HISTTIMEFORMAT='%F %T' #时间显示格式 export HISTTIMEFORMAT source /etc/bashrc [root@node1 ~]# history 473 2017-04-10 10:17:29cd /upload/plproxy-2.5 474 2017-04-10 10:17:29ll 475 2017-04-10 10:17:29yum list postgrews 476 2017-04-10 10:17:29yum list postgres 477 2017-04-10 10:17:29df -h 478 2017-04-10 10:17:29yum list 479 2017-04-10 10:17:29yum list postgres* 480 2017-04-10 10:17:29history 481 2017-04-10 10:17:29vim .bash_history 482 2017-04-10 10:17:29vim /etc/bashrc 483 2017-04-10 10:17:29history 484 2017-04-10 10:17:29source .bash_history 485 2017-04-10 10:17:37vim /etc/bashrc 486 2017-04-10 10:21:27history 可以发现执行生效之前的所有命令显示时间为上次关机的时间 另外千万不要错误的执行成了:source .bash_history 【将历史命令重新执行一遍!】
相关文章推荐
- linux中history命令显示操作执行的时间配置
- Linux 配置 history 命令显示操作时间、用户和登录 IP
- 如何让AIX、LINUX的History命令显示执行时间
- [Linux]history 显示命令执行的时间
- linux的history命令显示操作用户、显示操作时间、命令
- Linux之history命令显示用户名和操作时间
- 让linux的history命令显示操作时间
- Linux下查看用户登陆后的操作记录及history命令显示时间
- linux 命令执行历史记录history显示执行时间和用户
- Linux下查看用户登陆后的操作记录及history命令显示时间
- [Linux]history 显示命令执行的时间
- Linux下查看用户登陆后的操作记录及history命令显示时间
- Linux 重启配置, 让服务自启动, 以及如何让history命令 显示用户名和时间
- 如何让AIX、LINUX的History命令显示执行时间
- Linux下查看用户登陆后的操作记录及history命令显示时间
- Linux下查看用户登陆后的操作记录及history命令显示时间
- 让linux的history命令显示操作时间
- Bash下显示history记录的命令的执行时间
- history命令显示操作时间
- [Linux]history 显示命令的运行时间