Created
June 24, 2014 22:58
-
-
Save anonymous/1f1ff37c39bd20c9d666 to your computer and use it in GitHub Desktop.
fdups - Find file duplicates in given path(s) or current working directory
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
#! /bin/sh | |
fdups1() | |
{ | |
find "${1:-.}" -type f -printf '%s\n' | | |
sort -n | | |
uniq -d | | |
xargs -I@@ -n1 find "${1:-.}" -type f -size @@c -exec md5sum {} \; | | |
sort -k1,32 | | |
uniq -w32 -d --all-repeated=separate | | |
sed 's/^[^ ]\+ \+//' | |
} | |
for path | |
do | |
fdups1 "$path" | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment