How to clear ZSH history of commands executed on Mac Terminal


If you want to remove all the previous history of the commands that you may have executed on your Mac Terminal, you can do that by following the below commands.

% rm ~/.zsh_history

Careful with the below command, it will remove all sessions history!

% rm -r ~/.zsh_sessions

Restart your Terminal and all the history will be gone!

Both the .zsh_history file and .zsh_sessions directory will get re-created as you execute commands on the console.
Remove ZSH History Commands
-




Have Questions? Post them here!