Dupe guide

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.

4 min read

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:

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:

  1. It's slow. Hashing a 100 GB folder takes 20–40 minutes. SHA-256 isn't free.
  2. 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.
  3. Deletion is manual. No batch selection. You drag files to the Trash one by one.
  4. One typo can be disastrous. rm -rf doesn't ask. People wipe folders they meant to keep.
  5. 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.
  6. 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:

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.

← All Dupe tips