projects
/
www.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add script to find identical files
[www.git]
/
src
/
tricks
/
find_same_files.sh
diff --git a/src/tricks/find_same_files.sh
b/src/tricks/find_same_files.sh
new file mode 100755
(executable)
index 0000000..
a1f48ae
--- /dev/null
+++ b/
src/tricks/find_same_files.sh
@@ -0,0
+1,13
@@
+#!/bin/bash
+
+# Find same files in a given directory
+
+set -e
+
+if [ -z "$1" ]; then
+ SDIR="."
+else
+ SDIR="$1"
+fi
+
+find "$SDIR" -type f -exec md5sum {} \; | sort -n | uniq -w32 -D