I'm trying to delete the terminal history but the .zsh_history does not allow me to run it, it says permission denied. Please help.
2 Answers
At System Preferences/Security and Privacy/Privacy unlock the padlock and add the terminal to "Full disk access". Then reload the terminal and retry. https://support.apple.com/guide/mac-help/change-privacy-preferences-on-mac-mh32356/mac
-
Yeah! This helped, thank you! But the actual command was: rm ~/.zsh_history Commented Jun 3, 2021 at 4:34
Run it? Why would you run it? It's a file in your $HOME
. Delete it, if that's what you've set HISTFILE
to for the shell to keep the history in.
sudo chown -R $(stat -f %Su) ~