How to fix and recover zsh: corrupt history file /home/…/.zsh_history error

Gaurav Gandhi
1 min readFeb 3, 2020

--

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

--

--

Gaurav Gandhi
Gaurav Gandhi

Written by Gaurav Gandhi

10+ yrs exp. in software dev. Highly versatile and adaptable, learns new tech quickly to deliver top-notch results.

Responses (3)