How to find duplicate files on a Mac
Duplicates pile up quietly: the same PDF downloaded twice, a folder copied “just in case”, a burst of ten nearly identical photos. macOS has no built-in duplicate finder for files (Photos has its own Duplicates album for pictures), but you have a few good options.
Before you start
- Make a backup. Time Machine or any backup is fine. You will be moving files to the Trash.
- Decide what counts as a duplicate. Exact duplicates have identical contents, whatever their names. Similar photos look alike but aren’t byte-for-byte the same: burst shots, edits, or a HEIC and a JPEG of the same picture.
Option 1: Terminal, for exact copies
Terminal can find files with identical contents by comparing their SHA-256 hashes. This lists every file in Downloads whose contents match a file listed before it:
find ~/Downloads -type f -print0 | xargs -0 shasum -a 256 | sort | awk 'seen[$1]++'
Terminal may need permission to read Downloads, and every empty file counts as a copy of every other empty file, so ignore those. Each line shows a hash and a path. Every path printed is an extra copy of a file earlier in the sorted list. It works, but you then have to decide which copy to keep, by hand, for each one.
Option 2: Finder, for obvious cases
In Finder, open a folder, choose View ▸ as List, and sort by Name or Size. Copies often sit next to each other with names like “report (1).pdf” or “report copy.pdf”. This finds the obvious cases, but not a renamed copy in another folder.
Option 3: Sleuth, for exact copies and similar photos
Sleuth is a Mac file browser with a Duplicates view (⇧⌘D). It checks the folders you’ve added:
- Exact copies are found by content: Sleuth hashes files that share a size, so a renamed copy in another folder still counts.
- Similar photos are found with Apple’s Vision framework, on your Mac: bursts, edits and resized copies.
- A sensible copy is kept. For exact copies Sleuth prefers one outside Downloads, then one without “copy” or “(1)” in its name, then the oldest. For photos it prefers the highest resolution. Every copy has a Keep / Trash label you can change.
The header shows how much space the extra copies take. Review the groups and flip any Keep / Trash label you disagree with. Trashing a group’s extras in one go, or all exact-copy groups at once, is part of Pro; similar photos never have an all-at-once button, because look-alikes aren’t identical.
Removing duplicates safely
Whatever tool you use, send copies to the Trash rather than deleting them outright, and empty the Trash only once you’re sure. In Sleuth, files go to the Trash, and Put back returns a whole clean-up to where it was.
Moving a single file to the Trash is free in Sleuth. Trashing a whole set of extras in one go is part of Pro, and every feature is free during the free trial.