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

Where,

  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

OR
$ source ~/.bash_profile

 

Leer más