Mopup › Guides › Duplicate files

How to find and remove duplicate files on a Mac

Duplicates pile up quietly: a download saved twice, a video exported to two folders, the same photos copied off a camera more than once. Removing them is quick once you know which copies are truly identical.

Identical files and similar photos

An identical file is a byte-for-byte copy: the same content, whatever its name. Keeping one and removing the rest loses nothing. Similar photos, like the frames of a burst or a quick retake, are different files, and choosing between them means deciding which shot is better.

Start with Photos

If your pictures live in the Photos app, use its own tool: open Photos and choose Duplicates under Utilities in the sidebar. It merges duplicates inside your library. Don't remove files from inside the Photos library in Finder, which can damage the library.

Find identical files yourself

This lists files over 1 MB in your Downloads folder that have an identical copy there, by comparing their contents. It changes nothing:

find ~/Downloads -type f -size +1M -exec shasum -a 256 {} + | sort | awk '$1==h{print p; print} {h=$1; p=$0}' | uniq

Lines that start with the same long code are identical files. Change ~/Downloads to search another folder, such as ~/Documents.

Which copy to keep

Move duplicates to the Trash rather than deleting them outright, so you can put back a mistake.

Similar photos

For photos outside Photos, sort the folder by date: bursts and retakes are taken seconds apart, so they end up side by side. Select a few and press Space to compare them in Quick Look, then keep the sharpest.

Mopup's Identical Files on a demo Mac: an Xcode download saved twice, a screen recording in Movies and on the Desktop, and a video in two folders, 19.33 GB in extra copies.

Related guides