Created
June 4, 2021 12:20
-
-
Save atomicstack/2c5501f6210b6a303b626f447d50d487 to your computer and use it in GitHub Desktop.
cleans up duplicate zsh_history files from $PWD (double check paths before use!)
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
ls | egrep --line-buffered 'zsh_history.*xz$' | xargs sha256sum | pv -l -s $( ls | egrep --line-buffered 'zsh_history.*xz$' | wc -l | xargs ) | /usr/local/bin/sponge | perl -naE '$seen{$F[0]}++ or next; unlink $F[1] and say qq{unlinked $F[1]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment