dedupe tool
This commit is contained in:
16
dedupe
Executable file
16
dedupe
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
depth="-maxdepth 1"
|
||||
case "$1" in
|
||||
-r|--recursive) depth="" ;;
|
||||
-h|--help)
|
||||
echo "Usage: $(basename "$0") [-r]"
|
||||
echo " -r, --recursive search subdirectories too"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
find . $depth -type f -exec md5sum {} + | sort | awk '{
|
||||
if ($1 == prev) print "rm " $2
|
||||
prev = $1
|
||||
}'
|
||||
|
||||
Reference in New Issue
Block a user