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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.