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:
- Size. Files of different sizes cannot be identical.
- Fingerprint. A hash is a short code computed from a file’s contents. Files with the same hash are almost certainly identical.
- 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 -cmakes a clone. - Hard links. Two names point to the same file.
ls -lishows the same inode number for both, which is how you tell. We checked this on a test file withln. 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:
- 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.
- Does something depend on it? A project, a playlist or a photo library may refer to one path. Removing that copy breaks the reference.
- Is it inside an app’s library? Do not remove files inside the Photos or Music library packages. Those apps manage their own files.
- 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.