How to enable timestamp in .bash_history

Hello Friends

On RHEL 6.8

  • I did enabling time stamp for history command output.

echo ‘export HISTTIMEFORMAT="%d/%m/%y %T "’ >> ~/.bashrc
source ~/.bashrc

  • Now, i am looking for how to enable timestamp for .bash_history

Thanks in advance for your help!!!

echo ‘export HISTTIMEFORMAT="%d/%m/%y %T "’ >> ~/.bash_profile

just append your .bash_profile
and then run history command we will get the time stamp of all history command.

1 Like