How to: Clear the history on your Mac’s terminal (command prompt)

Sometimes you want to clear your history due to a number of reasons, like when you type a password and now it is being remembered by your terminal session. I’ve read this information is stored in your profile as a History file, and many people go as far as suggesting you should delete it. However, there is an easy command line you can execute that will clear your history and save you any troubles of messing with system files. Just execute the following line to clear your terminal history on your mac:

history -c

You may also like...

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.