Tuesday, 26 May 2009

Date and time stamped in linux history

To add the date and time to the history add the following two lines to /etc/profile:

HISTTIMEFORMAT="%D %T"
export HISTTIMEFORMAT

Now the history command will also display when the commands were run, very useful for audit purposes.

No comments:

Post a Comment