How to Clear Mac Terminal Command History - Delete Terminal Commands on an Apple Device

Having the terminal open, if we have previously used commands saved in the terminal history, we can use the up, and down keys to scroll through and use them quickly and efficiently.

To remove these commands from the terminal, open your finder, this should take you to your user profile area. Here press and hold the command, shift, and full stop buttons together to reveal any hidden files and folders.

Find the .zsh_history file and double-click that to open it, and you will see your terminal command history straight away. Simply remove the text content from here and close the file.

Then close out of your terminal if you have not already done so. The next time you open the terminal, you will find the previously saved commands are no longer appearing when the up or down keys are pressed.

If the commands are put back into the file, they will then reappear.

#mac #terminal #deleteMacTerminalHistory

For more videos like this see our YouTube video hub: https://www.youtube.com/@TekbitsYouTube

Connect with us on Instagram: https://www.instagram.com/_tekbits/

Connect with us on LinkedIn: https://www.linkedin.com/in/tekbits-limited-529835250/

#Technology #Software

How to Clear Mac Terminal Command History - Delete Terminal Commands on an Apple Device

Share this article