In Linux, you are familiar with the history command. It allows you to see which commands you have previously executed.
But there is one problem. The history command does not show when the command was executed by default.
In this quick tip, I'll show you how to enable timestamps in the history command.
export HISTTIMEFORMAT="%F %T " is a command used to set the format of the timestamp that is recorded in the command history. The command sets the timestamp format to be the full date and the full time, separated by a space. This allows the user to see the exact date and time when each command was executed in the command history.
export HISTTIMEFORMAT="%F %T "
However, because the changes are only valid for the current session, the history command will revert to its previous state after you log out.
To permanently apply the timestamp, make changes to the ~/.bashrc file.
vi ~/.bashrc
And now, whenever you use the history command, it will display the timestamps with each command.
Subscribe for more Linux tips!!!
PLEASE SUBSCRIBE :)
PLEASE HIT LIKE IF IT HELPED :)
GIVE SUPPORT - / lazysysad
BUY ME A COFFEE - https://www.buymeacoffee.com/lazysysad
PAYPAL - https://www.paypal.com/donate/?hosted...
Drop me your feedback and comments.
That's all for now.
If this video helped you in any way, please like share and subscribe!
Thank you!!!
On this page of the site you can watch the video online #linux with a duration of hours minute second in good quality, which was uploaded by the user The Lazy SysAdmin 26 January 2023, share the link with friends and acquaintances, this video has already been watched 2,339 times on youtube and it was liked by 157 viewers. Enjoy your viewing!