fix and recover a “corrupt history file” in zsh

Run the following code to fix error and recover history to new file

cd ~
mv .zsh_history .zsh_history_old
strings .zsh_history_old > .zsh_history
fc -R .zsh_history

Comments