Read more

How to fix a corrupt (zsh) history file

Andreas Robecke
July 28, 2015Software engineer

When you the following error:

zsh: corrupt history file /home/marc/.zsh_history
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

You can try and fix your history file by extracting only the valid strings:

cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history

fc -R .zsh_history # reloads the history
Posted by Andreas Robecke to makandra dev (2015-07-28 08:57)