Saturday, October 15, 2016

bash history with timestamps

This is definitely something useful!
How to attach timestamps to the history of the bash commands?
Simple:  just set (in the way you like to have your time format) the bash variable HISTTIMEFORMAT

For example to have the format: day/month/year - hours:minutes:seconds" type this:

export HISTTIMEFORMAT="%d/%m/%y - %H:%M:%S: "

and then just run history

That's it!

Source
 stackoverflow

No comments:

Post a Comment

Your comment will be visible after approval.