Bash history with timestamp

I often wish I knew when a command in bash’s history was run. Luckily, you can add it for all future commands. Put this in your bash_profile or bashrc:

HISTTIMEFORMAT='%F %T '

Now your history will look like:

 2015  2012-04-15 14:36:25 vim .bashrc
 2016  2012-04-15 14:38:50 history

 

Leave a Reply

Your email address will not be published.