I'd like to check at what time/date a command in bash history was executed. Is this possible?
How to see a timestamp for when a command was executed using history
bashhistorytimestamp
bashhistorytimestamp
I'd like to check at what time/date a command in bash history was executed. Is this possible?
Best Answer
It is possible. The
help history
command says:I set the variable for my user like this (on Ubuntu):
If you want it globally then add the line to
/etc/bash.bashrc
:See
man strftime
for all possible formatting optionsThe ouput of
history
on my box:P.S. When you set the variable the first time then the entire history will get the time stamp of the moment the variable was set.