How to find duplicate files on a Mac

Storage Published

All of mac tips Try NotchStar in the browser Buy for $4

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

  1. Group by size. Files with different sizes cannot be identical.
  2. Checksum the groups with the same size. A checksum is a long string computed from the contents.
  3. 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.

Keep reading.

How to find large files on a Mac
Find the biggest files and folders on a Mac with Storage settings, Finder size sorting and two Terminal commands. Tested commands, and what not to delete.
How to clear caches on a Mac safely
Which cache folders on a Mac are safe to clear, how to check their size, and the rule that keeps you out of trouble: one app at a time, with the app quit.
How to empty the Trash on a Mac safely
Empty the Trash from the Dock, restore items with Put Back, delete one item, handle locked files, and set the Mac to empty it after 30 days.
Disk space, duplicates, apps and cleanup
See free space, find big folders, duplicates and app leftovers, compress media and clean caches from your Mac notch. Everything goes to the Trash.
How to find what is filling your Mac, and free space safely
Find what fills your Mac with Finder and Terminal, learn which folders are safe to clear, and what to leave alone. Commands tested, with a 20 minute routine.

More in Storage.

How to check disk space on a Mac
See how much storage is used and free on a Mac in System Settings, in Finder, and with one Terminal command. Includes why the numbers can disagree.
What is System Data on a Mac, and can you delete it?
System Data is the catch all in Mac Storage for files that fit no other category. What it holds, why it grows and what is safe to look at.
How to find large files on a Mac
Find the biggest files and folders on a Mac with Storage settings, Finder size sorting and two Terminal commands. Tested commands, and what not to delete.
How to clear caches on a Mac safely
Which cache folders on a Mac are safe to clear, how to check their size, and the rule that keeps you out of trouble: one app at a time, with the app quit.
How to empty the Trash on a Mac safely
Empty the Trash from the Dock, restore items with Put Back, delete one item, handle locked files, and set the Mac to empty it after 30 days.
How to uninstall an app on a Mac and remove its leftover files
Use the app's uninstaller if it has one, otherwise move it to the Trash. Then check the Library folder for the cache, settings and data it left behind.
NotchStar app icon

Put your notch to work.

Buy it once for $4, activate it in a minute, and keep it. Not sure yet? Try every tool in the browser on the home page, or install the 7 day trial.