Saturday 22 September 2018

How to enable timestamp in command history CentOS 7



By default, time stamp information is not associated with executed history commands. To enable the time stamp on every bash command follow the below steps:

 Run the following commands to add time stamp on history file:

[root@linuxcnf ~]# echo "export HISTTIMEFORMAT='%F %T'" >> /etc/profile
[root@linuxcnf ~]# source /etc/profile

That’s it, now the history command show commands with execution time stamp.

No comments:

Post a Comment