HostOnNet Blog

How to Clear the Terminal History on Linux

Looking for Linux Server Admin or WordPress Expert? We can help.

Command history allows you to find and reuse previously typed commands.

How to clear the terminal command line history:

Login with the user account whose terminal history you plan to clear

Open a terminal window and type history -c


You can add the command to your ~/.bash_logout so that history will get cleared when you logout:

echo 'history -c' >> ~/.bash_logout

About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.

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.