/ "history" command - adding date to the output

"history" command - adding date to the output

A list of common commands:
We can limit the number of rows returned. For example, the command below will display a list of the last 25 commands:
# show all history commands
# display last 25 commands
history 25
To display the time and date when any command has been executed, need to set the "HISTTIMEFORMAT".
Open ~/.bashrc:
nano ~/.bashrc
And add the line at the end:
export HISTTIMEFORMAT="%h %d %H:%M:%S "
run the following command:
source ~/.bashrc
it will reload all the changes that we ordered.
Now try:
May the Force be with you,
Good Luck!!!
25-04-2017, 07:53
Go Back