LinuxOperating Systems

[How To] Clear bash history in Linux

Sometimes, sensitive commands are present in your server bash history. Another user logging in the server will be able to access history of your commands as Linux stores command in the .bash_history file of the user.

To delete / clear the bash history of a user, execute following command:

history -c && history -w

The above command will clear bash history and generate an empty .bash_history file.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button