Duplicate files build up quietly: the same installer downloaded twice, photos imported from two devices, a project folder copied "just in case". They are easy to create and slow to find by hand. Here are the methods built into macOS, and how to make sure a file really is a copy before you delete it.
1. Duplicate photos and videos in Photos
- Open Photos and click Duplicates under Utilities in the sidebar. It appears once Photos has finished checking your library.
- Review each set. Photos shows exact copies and photos that look the same but differ in resolution or details.
- Click Merge. Photos keeps the highest-quality version, combines captions, keywords and favorites, and moves the rest to Recently Deleted.
Don't remove photos from inside the Photos Library in Finder; always use the Photos app.
2. Duplicate songs in Music
In Music, choose File › Library › Show Duplicate Items. Hold Option and choose Show Exact Duplicate Items to see only songs with the same name, artist and album. Delete the extras from the library, and choose to move the files to the Trash if Music asks.
3. Likely duplicates in Finder
- Open a Finder window, press Command-F and choose This Mac.
- Search for a file type, such as Kind is Document or Kind is Image, or a name like "copy".
- Choose View › as List, then sort by Name and look for matching names and sizes, or names ending in "copy", "(1)" or "2".
This finds candidates, not proof. Open both files, or confirm with the next method.
4. Exact duplicates with Terminal
A checksum is a fingerprint of a file's content: identical files have identical checksums. This command lists files over 1 MB in Documents whose content appears more than once. It only reads; it doesn't change anything.
find ~/Documents -type f -size +1M -exec md5 -r {} + 2>/dev/null | sort > ~/dupes.txt
cut -d' ' -f1 ~/dupes.txt | uniq -d > ~/dupe-codes.txt
grep -F -f ~/dupe-codes.txt ~/dupes.txt
Each group of lines that starts with the same long code is a set of identical files. Change ~/Documents to another folder to check it, and delete ~/dupes.txt and ~/dupe-codes.txt when you're done.
Which copy to keep
- Keep the copy in the folder you actually use, not the one in Downloads or the Desktop.
- Keep the oldest copy if dates matter to you, such as photos and contracts.
- Be careful inside app folders, libraries and code projects: an app may need its own copy of a file.
- Leave files in iCloud Drive until you're sure, because deleting there removes them from every device.
Where TheCleanDisk helps
TheCleanDisk's Duplicates tool checks files byte by byte, so it only lists exact copies, and it always keeps at least one copy of each set. Nothing is selected for you, and anything you remove waits in quarantine for 7 days. It is free on the Mac App Store.