#!/bin/sh | |
# Borrowed from http://marcparadise.com/blog/2013/09/21/how-to-fix-a-corrupt-history-file/ | |
# If you ever see a message like this upon starting a new shell | |
# zsh: corrupt history file /home/marc/.zsh_history | |
# here is a quick fix | |
cd ~ | |
mv .zsh_history .zsh_history_bad | |
strings .zsh_history_bad > .zsh_history | |
# And reload history | |
fc -R .zsh_history |
快捷方式
curl https://gist.githubusercontent.com/kolach/fa104674bf2803fb4d54/raw/e2db3adc1a8be7d08bd45e335d5518b714e01b10/fix_zsh_history.sh | zsh