[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.

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on StumbleUpon1Share on LinkedIn5Share on Tumblr0Pin on Pinterest0Email this to someonePrint this page

About Abhijit Sandhan

Abhijit Sandhan

Loves Linux, Blogging, Traveling, Hiking and sharing Knowledge!

Leave a Reply

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