Created
March 5, 2022 22:25
-
-
Save atomicstack/93bb6f48dc5b0dbccaf14a840d16ddbe to your computer and use it in GitHub Desktop.
removes files with duplicate SHA-256 hashes. tweaked enhancement of https://gist.github.com/atomicstack/2c5501f6210b6a303b626f447d50d487
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
find . -type f -print0 | xargs -0 sha256sum | pv -l -s $( find . -type f | wc -l ) | sponge | perl -naE 'my $hash = shift @F; $seen{$hash}++ or next; $ENV{UNLINK_FILES} and unlink "@F"; my $result = $! ? "failed" : ""; say qq{unlinked @F $result}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment