How to display the timestamp in your bash history

It's nice to have quick access to your command history on the command line, but sometimes it's valuable to know exactly when you typed a command. This guide will show you how to customize the output of the history command.

Here's a bit more on HISTTIMEFORMAT from gnu.org documentation: If this variable is set and not null, its value is used as a format string for strftime to print the time stamp associated with each history entry displayed by the history builtin. If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions. This uses the history comment character to distinguish timestamps from other history lines.