How to see time stamps in bash history

El Blog de Dragonfly
Defining the environment variable named HISTTIMEFORMAT as follows:

$ HISTTIMEFORMAT="%d/%m/%y %T "

OR add to your ~/.bash_profile file, enter:
$ echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile


  1. %d – Day
  2. %m – Month
  3. %y – Year
  4. %T – Time

Use the source command to load HISTTIMEFORMAT from file into the current shell script or a command prompt:

$ . ~/.bash_profile

$ source ~/.bash_profile


Leer más