CleanMate

Find duplicate files and similar photos on Mac and Ubuntu

Two copies of the same 4 GB video cost 4 GB. CleanMate finds identical files by their content, and photos that only look alike, such as bursts and edited copies, and helps you keep one of each.

Two different kinds of copies

A duplicate is byte for byte the same file under another name or in another folder: a download saved twice, a backup copied into a project, a folder that was copied and never cleaned. Comparing names does not find them, because the names differ. Comparing content does.

A similar photo is different: a burst of ten shots, a photo resized for email, an edited copy next to the original. No two files are identical, but you only need one. This needs a look at the picture, not at the bytes.

How the search works

  1. Choose where to look. On a Mac, open Large & Old Files and choose Duplicate Files in the Kind menu, which searches your whole home folder in seconds, or Similar Photos. On Ubuntu, Duplicates searches the folder or drive you pick, for files of 1 MB or more.
  2. Review each group. Identical files are grouped together, with every copy’s folder and date. Similar photos are grouped too, and CleanMate suggests which one to keep.
  3. Keep one, tick the rest. On a Mac, Select All but Suggested ticks every copy except the suggested one (the copy outside Downloads, then the oldest). On Ubuntu, Select automatically ticks every copy except the oldest. You are warned if every copy of a file is ticked. Nothing is ticked until you choose.
  4. Move to the Trash. Only what you ticked goes to the Trash, and Undo puts it back. On an external drive, files go to that drive’s Trash. Stop keeps what has been found so far.
Large and old files on a Mac sorted by size, with filtersLarge and old files on a Mac sorted by size, with filters
Duplicates on Ubuntu, identical files shown in groups

Where Mac and Ubuntu differ

macOS

On a Mac, files are compared by content (SHA-256) and the home search takes seconds. APFS clones are labelled as freeing no space, and are never ticked by Select All but Suggested. Similar Photos compares JPEG, HEIC, PNG, TIFF and WebP photos on your Mac and ticks nothing for you.

Ubuntu

On Ubuntu, Duplicates is its own page, and the search starts from the folder or drive you pick. Similar Photos finds resized, edited and burst copies, suggests the one with the most pixels to keep, and runs on your computer only.

What keeps it safe

The same from the terminal

Listing duplicates is read-only on both systems. On a Mac, similar also lists look-alike photos; on Ubuntu, Similar Photos is in the desktop app.

SystemCommandWhat it does
macOScleanmate dupes [--min-size SIZE] [--in PATH] [--limit N] [--json]Duplicate files in groups, each copy with its last change and what moving it frees.
macOScleanmate similar [PATH…] [--limit N] [--json]Photos that look alike: groups by space to free, the one suggested to keep first.
macOScleanmate trash [--yes] [--json] [--] PATH…Moves the copies you name to the Trash; nothing is deleted.
Ubuntucm --json dupes [--min BYTES] [--path DIR] [--limit N]Groups of identical files, newest copy first. Similar Photos is in the desktop app.
Ubuntucm --json trash [--home-only] PATH…Moves the copies you confirmed to the Trash.

Questions

How does CleanMate know two files are the same?

By content, not by name or date. On a Mac files are compared with SHA-256, so a renamed copy is still found and two different files with the same name are not mixed up.

Why does a copy say it frees no space?

On a Mac with APFS, a clone made by Finder’s Duplicate or cp -c shares its data with the original, so moving it frees nothing. CleanMate labels these and never ticks them for you.

What size of file does it look for?

On Ubuntu, 1 MB or more in the folder or drive you pick. On a Mac, 1 MB or more by default, or 100 KB, 10 MB or 50 MB from the Size menu.

Can I find similar photos on Ubuntu?

Yes. Similar Photos is on the Duplicates page of the Ubuntu desktop app. It finds resized, edited and burst copies and suggests the one with the most pixels to keep.

Does it delete my originals?

It moves only what you tick to the Trash. It suggests which copy to keep, and on Ubuntu it warns you before you tick every copy of a file.

Get CleanMate

Free and open source. Review every item before it is removed.

Open source — star it on GitHub: CleanMate for macOS · CleanMate for Ubuntu