In this tutorial, How to list command display date and time command previously typed in Bash History. The Bash shell provides the command history.
Display Date and Time for each Command in Bash History.
The default history command
$ history
The output terminal as below
Set time stamps in bash history
Define the environment variable name
$ HISTTIMEFORMAT="%d/%m/%y %T "The output as below
Or your add ~/.bash_profile file
$ echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile
$ cd
$ source ~/.bash_profile
The output terminal as below
To retrieve Linux bash command line history
$ history
The output terminal as below
Thanks for reading Display Date and Time for each Command in Bash History My blog Zimbra Mail Server,linux,bash script,centos,linux command I hope this is useful.