Page 1 of 1

history -c

Posted: 2021-Jul-29, 8:43 pm
by flair
It is no longer possible for me to clear my Terminal in macOS (Big Sur v11.5).

https://ss64.com/osx/history.html is not showing correct information anymore.

Others than me seem to have the same issue: https://github.com/ohmyzsh/ohmyzsh/issues/8869

Please help me clear my Terminal history.

Thank you.

Re: history -c

Posted: 2021-Jul-29, 9:56 pm
by Simon Sheppard
Hi flair

The history command is a built-in command so the options will be different when running the bash shell or the zsh shell on macOS.

I am planning to update the SS64 pages to cover both bash and zsh, but that probably wont happen until next year.

In the meantime, this stackexchange answer details how to clear history in zsh, it should be the same on macOS

https://unix.stackexchange.com/question ... ory-in-zsh

Code: Select all

function erase_history { local HISTSIZE=0; }
erase_history