1

I can't delete the shell history in macOS Catalina. I use rm ~/.bash_history.

history -c all command fields. I need to delete the command history.

1
  • Which shell are you using, bash, zsh or something else? If unsure, run ps -p $$ and look into the CMD column. – nohillside Dec 14 '19 at 18:37
2

Just do a

rm ~/.zsh_history

that clears the history. After that close the Terminal app. To check if the history was cleared run

history

in Terminal.

1
  • its works perfectly in Catalina – DragonFire May 22 '20 at 0:50
1
  • Close all terminal tabs and windows except one
  • rm ~/.bash_history
  • history -c
  • Quit and restart Terminal
5
  • 1
    Try rm ~/.zhistory? ;-) – klanomath Dec 14 '19 at 12:27
  • @klanomath Might be an option, once the OP clarifies which shell they use :-) – nohillside Dec 14 '19 at 13:31
  • I thought Catalina defaulted to zsh... – Allan Jan 4 '20 at 13:05
  • @allan for new accounts only – nohillside Jan 4 '20 at 13:28
  • @nohillside - Ahhh...so used to doing clean installs and not upgrading that I miss those details. Thx. – Allan Jan 4 '20 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .