Find duplicate files on Mac without third-party software (and why it's painful)
You can find duplicates with just Finder and Terminal. Here's how, and an honest look at why most people give up.
macOS doesn’t have a built-in duplicate finder, but you can build one yourself with Terminal commands. It works. It’s also slow, error-prone, and most people abandon it halfway. Here’s the honest version.
The Terminal approach
The general idea: hash every file, sort by hash, find duplicates. Here’s the one-liner.
find ~/Documents -type f -exec shasum -a 256 {} + 2>/dev/null | sort | uniq -d -w 64
Breakdown:
find ~/Documents -type f— every file in Documents-exec shasum -a 256 {} +— compute SHA-256 of eachsort— sort by hashuniq -d -w 64— show only duplicates, comparing the first 64 characters (the hash)
Wait. Watch your fans spin up.
Scoped variation: find duplicates of a specific file
shasum -a 256 ~/Documents/important.pdf
# Get the hash, then:
find ~ -type f -exec shasum -a 256 {} + 2>/dev/null | grep "the-hash-you-just-got"
That gives you every file on your Mac that’s byte-identical to important.pdf.
A smarter version using file sizes first
Hashing every file is slow. Files with different sizes can’t be duplicates, so filter first:
find ~/Documents -type f -exec stat -f "%z %N" {} + 2>/dev/null | sort | awk '
{
if ($1 == prev_size) print prev_path"\n"$2;
prev_size = $1; prev_path = $2;
}'
That lists pairs of files with matching sizes. Then hash just those pairs to confirm.
The painful parts
Here’s why people give up on the Terminal approach:
- It's slow. Hashing a 100 GB folder takes 20–40 minutes. SHA-256 isn't free.
- The output is raw. You get a list of hashes and paths, not a UI for reviewing. Mentally pairing up which copies to keep across 200 groups is brutal.
- Deletion is manual. No batch selection. You drag files to the Trash one by one.
- One typo can be disastrous.
rm -rfdoesn't ask. People wipe folders they meant to keep. - It can't tell you which copy to keep. Even if you find the duplicates, you still have to decide which is the "real" one.
- Excluding system files is on you. Run it on
/without filters and you'll find duplicates in app bundles and system frameworks you must not touch.
When the Terminal approach is fine
Use Terminal when:
- You have under 10 GB to scan
- You only want to find duplicates of one specific known file
- You’re comfortable with the output and don’t mind reviewing manually
- You’re going to script the deletion yourself
When it isn’t
If you’re scanning a Documents folder with thousands of files, a Photos library, or want to clean up across the whole disk, the Terminal route turns into a weekend project.
Download Dupe if you want the same SHA-256-based detection without the pain. It hashes files in parallel (faster), gives you a UI for reviewing groups, lets you batch-select with one click, and moves duplicates to the Trash instead of permanent deleting. Plus it excludes system files and app bundles by default — none of the “I accidentally hashed all of /System” risk.
$14.99 one-time. The hours saved over the manual approach pay for it before lunch.
More Dupe tips
-
Apple Photos Duplicates album — what it catches and what it misses
The Photos app Duplicates album is handy, but it has real limits. Here's what it finds, what it doesn't, and how to fill the gaps.
-
Clean up leftover files from uninstalled apps on Mac
Dragging an app to the Trash doesn't remove all its data. Here's where the leftovers live and how to clean them.
-
Clean up your Mac without buying a cleaner app
Most paid cleaner apps do things macOS already does. Here's a free, manual workflow that's just as effective.
-
A no-bullshit guide to cleaning up your Mac's disk
Skip the SEO bait and the sketchy cleaner apps. Here's what actually works to reclaim disk space on a Mac.