twitter
Technical Tips
How To Enable Timestamps in History Command under Unix Environment

When we run the “history” command it only gives you command along with the line numbers. Sometimes it’s useful to have a time stamp attached to each command to build a clearer picture.

 

Below example shows the history command output without timestamps.

 

To enable the timestamps  in history command we have to set  “HISTTIMEFORMAT “  environment variable.

 

# export HISTTIMEFORMAT="%F %T "

 

To permanently set this variable use  .bashrc file

 

Below Output shows timestamps along the commands.

 

 

Kindly share your feedback & queries at info@nextstep4it.com
Submitted By : Parveen Antil
Email Id : parveen.antil@gmail.com