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!!!
Auf dieser Seite können Sie das Online-Video #linux mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer The Lazy SysAdmin 26 Januar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,339 Mal angesehen und es wurde von 157 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!