#linux

Pubblicato il: 26 gennaio 2023
sul canale di: The Lazy SysAdmin
2,339
157

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!!!


In questa pagina del sito puoi guardare il video online #linux della durata di ore minuti seconda in buona qualità , che l'utente ha caricato The Lazy SysAdmin 26 gennaio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 2,339 volte e gli è piaciuto 157 spettatori. Buona visione!