Last active
September 24, 2021 04:29
-
-
Save 1eedaegon/c2152c0b0e544ac84b15343cada2f84a to your computer and use it in GitHub Desktop.
How to recover corrupted zsh_history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. Move home directory | |
$ cd ~ | |
# 1. Rename corrupted zsh_history | |
$ mv .zsh_history .zsh_history_bad | |
# 2. Encoding zsh_history_bad | |
$ strings -eS .zsh_history_bad > .zsh_history | |
# 3. Read history from file | |
$ fc -R .zsh_history |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment