Find duplicate files by content, not by name, and send the extra copies to the Trash while always keeping one. A 124-line bash script that runs as a double-clickable Mac app.
A personal case study, published for review rather than reuse. One script, plus the recipe for wrapping it as a Mac app.
└── dedupe-ui.sh folder picker, mode dialog, hashing, report, removal
Every destructive default is the safe one. Report before remove. Trash rather than
delete. Always keep one copy. Refuse to run if trash isn't installed rather than quietly
falling back to rm. Writing a tool that touches someone's files is mostly an exercise in
deciding what it should refuse to do — which is the same problem as giving an AI agent
write access, and the reason this small script kept teaching me things after it worked.
Only files sharing an exact byte size are hashed. Size is free to read and a perfect negative filter, so the expensive step runs on a tiny fraction of the disk. On a real folder this is the difference between seconds and minutes.
The interface is osascript. A folder picker and a three-button dialog, no GUI
framework, no dependencies. Wrapped with Platypus it
becomes an app you double-click.
brew install trash
./dedupe-ui.shTo build the app: Platypus → Script Type /bin/bash, Script Path dedupe-ui.sh, Interface
Text Window. The built .app isn't committed — it takes a minute to make.
Bash and macOS built-ins (shasum, find, osascript). One optional external tool.
All rights reserved. Published for review, not for reuse — see LICENSE.
External tools: see NOTICE.md.