Skip to content

Instantly share code, notes, and snippets.

@musale
musale / fix.md
Last active May 31, 2024 19:41
How to fix and recover a “corrupt history file” in zsh
# move to home directory
cd ~

# move the .zsh_history file into another .zsh_history_bad file
mv .zsh_history .zsh_history_bad

# write all printable strings into a new .zsh_history file
strings .zsh_history_bad > .zsh_history