Linux Command History with date and time

Rushvi picture Rushvi · Jul 22, 2016 · Viewed 106.9k times · Source

I wants to check on my linux system when which command was fired - at which date and time.

I fired commands like this:

history 50 

It shows me the last 50 commands history, but not with date and time at which it was fired. Does any one knows how to do it?

Answer

Hossein Vatani picture Hossein Vatani · Feb 1, 2017

Regarding this link you can make the first solution provided by krzyk permanent by executing:

echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile
source ~/.bash_profile