Clear the terminal’s command history

Sometimes you just need to clear your history in Terminal. It’s actually pretty easy to do.

If you’d rather not have your history saved to a file at all, add the following line to your ~/.bash_profile:

This way, your command history is limited to only those commands you used during the current session. More information and options can be found on the bash man page

Leave a Reply

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