How-To Geek

How to Clear the Terminal History on Linux or Mac OS X

Every now and then we realize that there’s a tip that we haven’t covered, and even when it’s as simple as clearing your terminal history, we feel compelled to write about it. Here’s how to clear your history on Linux or Mac OS X.

It’s really simple. Just type this command:

history -c

Our job is done. Your history is cleared.

In case you were wondering, all that history is stored in the ~/.bash_history file — that tilde and slash represent your user folder, so it’s really something like /home/username/.bash_history and it contains all of the commands you’ve typed at the terminal.

You could, of course, just edit that file to remove the line that you’re trying to get rid of. Because you’d never type a password in clear text, right?

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 03/7/14

More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!