How to fix a corrupt zsh history file

Posted by Ben McLaren

7 months ago

0

zsh terminal

Error message:

zsh: corrupt history file /home/go/.zsh_history


To fix it run the following commands:


cd ~

mv .zsh_history .zsh_history_bad

strings .zsh_history_bad > .zsh_history

fc -R .zsh_history

rm ~/.zsh_history_bad