HostOnNet Blog

How to Clear the Terminal History on Linux

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

history

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.