history -c

Bash shell questions
Post Reply
flair
Posts: 1
Joined: 2021-Jul-29, 8:38 pm

history -c

Post 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.
User avatar
Simon Sheppard
Posts: 29
Joined: 2021-Jul-10, 7:46 pm
Contact:

Re: history -c

Post 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
Post Reply