Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 262010

Display timestamp information in command history


When using the history command, it only shows the command number and the command itself. But sometimes it is useful to know when this command was executed, i.e. the timestamp. To do so, following the instructions below:

# export HISTTIMEFORMAT='%F %T '

Then type history again

# history
 260  2010-12-23 19:22:07 ls
 261  2010-12-23 19:22:07 pwd

That's all.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>