Skip to content

Instantly share code, notes, and snippets.

@atomicstack
Created June 4, 2021 12:20
Show Gist options
  • Save atomicstack/2c5501f6210b6a303b626f447d50d487 to your computer and use it in GitHub Desktop.
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!)
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