Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Enable timestamps for bash history

The HISTORY command in bash lets you see the last 1000 commands issued at the terminal. By default, this list does not contain timestamps for the commands you’ve issued.

To enable timestamps, issue the following at the terminal:

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

The timestamp for commands before this step will not be accurate, they will be accurate for newer commands.

Issue history at the terminal again and you should see timestamps appended now.