reinhard.fun Blog

Go Back

clean/prune history

mac zsh shell

the default shell on mac is zsh. There you can type in your commands and later you get get the commands with the history command.

user@~/ >history
    1  history
    2  ls
    3  ls -an
    4  pwd
user@~/ >

Sometimes you want to clean your history. On bash-shell it is the history -c command. But on zsh this can be done by history -p. (this sounds like prune).

user@~/ >history -p
user@~/ >history
    1  history
user@~/ >