ZSH

Fix ZSH histroy file corruption

Posted by ChenRiang on July 7, 2021

Today after a force reboot, I get a ZSH history file corruption error message.

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


Solution

Solution to solve this error message is relatively easy.

1
2
3
4
cd ~
mv .zsh_history .zsh_history_bak
strings -eS .zsh_history_bak > .zsh_history
fc -R .zsh_history