How to find duplicate files on a Mac
Finding true duplicates means comparing what is inside the files, not their names. Two files with the same name are not necessarily the same, and two with different names can be identical. By hand you group files by size, then compare a checksum of each group. A tool does that across a whole disk.
The method
- Group by size. Files with different sizes cannot be identical.
- Checksum the groups with the same size. A checksum is a long string computed from the contents.
- Matching checksums mean the same content.
By hand for one folder
If you suspect two files match, run this in Terminal:
shasum -a 256 ~/Downloads/report.pdf ~/Downloads/report\ copy.pdf
If both lines begin with the same long string, the files are identical and you can keep one. Move the other to the Trash.
Finder can narrow it down first
In Finder, open the folder, switch to list view and sort by Size. Files with identical sizes land next to each other, and those pairs are the ones worth checking with a checksum.
Traps
- Hard links. A hard link is one file stored under two names. Deleting one frees no space. A good duplicate finder skips them, and a quick one may report space you will never get back.
- Same name, different content. A name is not evidence. Compare content.
- Your only copy. Before removing a folder of photos or documents, make sure one copy stays.
Doing it across the disk
By hand across the whole disk is slow, which is the honest reason duplicate finders exist. Whichever you use, check that it compares content, tells you which copy it keeps, and moves files to the Trash instead of deleting them.
After you clear them
Items in the Trash still use space until you empty it. Apple says so on its storage page. Read empty the Trash safely. To find big folders first, see find large files.
In the notch
NotchStar’s Disk tool has a Duplicates section. It compares files byte for byte across Downloads, Documents, Desktop, Pictures, Movies and Music, keeps the oldest copy, and skips files smaller than 1 MB. Removed copies go to the Trash.