dedupe tool

This commit is contained in:
2026-06-11 19:04:15 -07:00
parent b31d0756d9
commit 3ca0d44655

16
dedupe Executable file
View 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
}'