Skip to content

Commit 7a7adb7

Browse files
committed
Added find-dupliate-files.sh
1 parent 7be9a65 commit 7a7adb7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: find-duplicate-files.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
case "${#}" in
4+
0)
5+
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
6+
;;
7+
1)
8+
find "${1}" -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find "${1}" -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
9+
;;
10+
*)
11+
echo "Usage: $(basename ${0}) [directory]"
12+
;;
13+
esac
14+

0 commit comments

Comments
 (0)