Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also?
Bottom-Line: Execution time in the Bash history
bashcommand lineenvironment-variableshistorytimestamp
Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also?
Bottom-Line: Execution time in the Bash history
Best Answer
Press Ctrl+Alt+T to open a terminal, then run one of the commands below:
To make the change permanent for the current user run:
To test the effects run:
For more info see man bash or An A-Z Index of the Bash command line for Linux.
For commands that were run before
HISTTIMEFORMAT
was set, the current time will be saved as the timestamp. Commands run afterHISTTIMEFORMAT
was set will have the proper timestamp saved.