This is useful tip if there are multiple people maintaining a given server (so you can see when a command was performed) or even if you are the maintainer, but can’t remember exactly when you did or changed something.

First,edit $HOME/.bashrc file by this command:

gedit $HOME/.bashrc

Add this line into the file,save and close it.

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

Logout and back in,and you will get history with date and time like this:

1002  May/09 – 11:46:16 grep log /var/log/maillog
1003  Apr/09 – 14:17:40 passwd test
1004  Apr/09 – 14:50:28 history 15