Bash History | When did I run that!
History is a wonderful way to keep track of what we did or where we went. Sometimes, we aren’t interested in having the history logged so that we can maintain some sort of secret activity. But trust me, at times it is very very useful.
But what use is history without the time when the activity took place! Time and Place play very important role. In bash history, the Time can be of great use to know, when a particular command was run.
This get extremely handy, when on a server and you need to find out when a particular command was run.
I guess you have figured out what I am getting to! Yes, time stamps in Bash History.
In shell set this environment variable
$ HISTTIMEFORMAT=”$d-%m-%y %T “
and then run history!
$ history
You will get the time stamp of when the command in your history was run!
Cool huh?
