Skip to cookie settings

Find duplicate files on Mac without losing the one you need

Matching names are not enough. Here is how to check that two files are identical, and how to pick the copy to keep.

Part of: How to uninstall apps on Mac completely, leftovers included (Uninstall and duplicates)

Two files with the same name are not necessarily the same file, and two files with different names may be identical. To find real duplicates, compare size first, then a content fingerprint. Then choose which copy to keep by where it lives, not by its date. If you cannot decide, keep both.

DiskJoy is our product. It does not find duplicates today: the scan is read-only, shows reclaimable space by category, and removal is not built yet. This guide teaches the manual way, and the commands below only read.

What counts as a duplicate

A reliable check has three stages:

  1. Size. Files of different sizes cannot be identical.
  2. Fingerprint. A hash is a short code computed from a file’s contents. Files with the same hash are almost certainly identical.
  3. Byte by byte. If it matters, compare the files directly.

You can do the same by hand for two files. This prints a fingerprint for each:

shasum -a 256 one.pdf two.pdf

If the two lines start with the same code, the contents match. This prints nothing when the contents match:

cmp one.pdf two.pdf

We ran both on a pair of copied test files and got matching fingerprints and no output from cmp.

Name, date and location help you choose which copy to keep. They do not tell you whether two files are copies.

Find big files first

Duplicates of small files rarely matter. Start with large files. This lists files over 100 MB in Downloads, read-only:

find ~/Downloads -type f -size +100M

Change the folder and size to suit you. Copies of installers and videos are common in Downloads. Our guide to finding large files goes further.

Copies that may not use extra space

On a modern Mac with APFS, some duplicates share their data on disk:

  • Clones. When Finder duplicates a file on the same volume, APFS can create a clone that shares the original’s data until one of them changes. Removing one of two clones frees little or nothing. In Terminal, cp -c makes a clone.
  • Hard links. Two names point to the same file. ls -li shows the same inode number for both, which is how you tell. We checked this on a test file with ln. Removing one name does not free space while another remains.

This is why a list of duplicates and the space you get back are different numbers.

Choosing the copy to keep

These questions help more than the date:

  1. Where does each copy live? A copy in Documents or a project folder is usually the one you meant to keep. A copy in Downloads is usually a leftover.
  2. Does something depend on it? A project, a playlist or a photo library may refer to one path. Removing that copy breaks the reference.
  3. Is it inside an app’s library? Do not remove files inside the Photos or Music library packages. Those apps manage their own files.
  4. Is one copy only in the cloud? A placeholder stored only in iCloud is not a second local copy, and removing it can remove it from iCloud.

If you cannot decide, keep both. An unneeded duplicate costs some space. The wrong deletion can cost your only copy.

Removing a duplicate safely

Move the extra copy to the Trash instead of deleting it, and keep it there for a while. The Trash guide explains why space returns only when the Trash is emptied. Our guide to uninstalling apps uses the same cautious order, and what apps leave behind shows it for leftover files.

A calm way to start

Pick one folder, such as Downloads. Sort it by size in Finder. For the biggest few files, ask whether you have another copy elsewhere. Check with shasum -a 256 on both. You may find only a handful of real duplicates, and that is a normal result. The aim is to get back a little space safely, not to hunt every copy.

Safe, Risky, Never

Level What it covers
Safe A copy in Downloads that has the same fingerprint as a file in a project folder you chose to keep
Risky Copies that a project or playlist points to. Copies whose location tells you nothing. Clones and hard links, which free little
Never Anything inside the Photos library package or another app’s library. System files. Files whose match you did not check

Where DiskJoy fits today

DiskJoy is in pre-alpha. It scans the folders you choose, read-only, and reports allocated bytes. Because APFS clones share data, that figure can overstate what you would get back, so the reclaimable estimate is only a lower bound and leaves out shared extents. It does not list duplicates and it does not remove files today. Photos libraries are protected and are not offered for cleaning.

Try a scan

To see which folders hold the most data before you hunt for copies, run DiskJoy’s scan. It reads only.

Sources and disclosure

The read-only commands shasum -a 256, cmp, ls -li, ln and cp -c on temporary test files, and find -size, were run on macOS 27.0. Allocated-space behaviour is described in DiskJoy’s engine notes (docs/phase2/read-only-scan.md).

Frequently asked questions

How do I find duplicate files on Mac?

Compare file size first, then a content fingerprint. In Terminal, shasum -a 256 on two files prints a fingerprint for each, and cmp prints nothing when the contents match. Do not rely on names or dates.

How do I delete duplicate files on Mac?

Decide which copy to keep, then move the other to the Trash and keep it there for a while. Do not remove copies inside the Photos or Music library packages.

Do duplicate files always use extra space?

Not always. On APFS, a clone shares its data with the original, and a hard link is the same file under two names. Removing one of these frees little or nothing.

Tags:DuplicatesDisk spaceFiles

See what’s taking up space on your Mac

DiskJoy explains every item and removes nothing until you review it.
Download for Mac

Cookies on diskjoy.com

Your browser sends a Global Privacy Control signal. We honoured it: analytics and marketing cookies are off.

Necessary cookies run this site. Analytics shows us how it is used: if you accept it, Google receives data about your visit. Change this anytime in Cookie Settings. How Google uses data Cookie Policy Privacy policy

Customize

Purpose
Needed for the site to work and to remember your cookie choice.

Cookies

  • sy_consent - Stores your cookie choice (Retention: 12 months)

Other browser storage

  • sy_consent_pending (localStorage) - Queues your choice until it reaches our server (Retention: until deleted)
Purpose
Show us which pages are visited and how the site is used, so we can improve it. Provider: Google Ireland Ltd (Google Analytics 4).

Cookies

  • _ga - Distinguishes visitors to count them (Retention: 400 days)
  • _ga_TP2XMLG27P - Keeps the state of your current visit (Retention: 400 days)

Recipients

Data controller

Sylentis Group sp. z o.o.. Contact: support@diskjoy.com. Privacy policy

Google may process data outside the European Economic Area (EEA). Safeguards: EU-US Data Privacy Framework, standard contractual clauses.

Right to withdraw

You can withdraw consent at any time, as easily as you gave it. Withdrawal does not affect the lawfulness of processing before it.