Sunday, July 16, 2017

# bash_profile user # histtimeformat in linux

How to use HISTTIMEFORMAT in Linux

For my test I am using a CentOS VM

If you want a time-stamp to go along with your commands you will need to use the HISTTIMEFORMAT utility in user's bash_profile

For comparison purposes I have shown a HUGE difference it can make when you use a space and no space with HISTTIMEFORMAT

As usual, we make a backup copy of the user's bash_profile before we go clobbering it

Then, add the export HISTTIMEFORMAT="%F %T " line in the user's bash_profile

If you use export HISTTIMEFORMAT="%F %T" this is what you get

So, a teeny tiny space can make a huge difference in Linux!

No comments:

Post a Comment