Clear history in zsh
Using the Command Line
In zsh, you can clear the command history by using the following command instead of history -c:
history -p
Using the Zsh History File
Zsh stores your command history in a file called .zsh_history. To clear your command history using the history file, follow these steps:
- Open the
.zsh_historyfile in your favorite text editor. - Delete all the entries in the file.
- Save the file and exit the text editor.
Some of the content is generated by AI, please be cautious in identifying it.