How to find and remove duplicate files on a Mac

8.2K views
6 min read

The dreaded “running low on storage” error message — we all hate it. When your Mac starts to run out of space, one of the most effective ways to clean it up is to find any duplicate files you can delete. Photos, videos, songs, email attachments, old documents — anything that's easy to download and forget about.

Duplicate files on your Mac are largely useless, and managing them is important. More duplicate files means less resources for your Mac, and a slow Mac is really frustrating to use.

Many users just don't think to find duplicate files on their Mac, much less delete duplicate files when they're aware of them. There are a few really good ways to remove duplicate files on your Mac; we'll show you the absolute best methods here.


Best ways to remove duplicates on your Mac

Having duplicate files on your Mac may not be your fault. There are times when you duplicate a file to alter it, but never get around to those changes. You may also import images you already have in your Photos app, or have multiple video or audio files lurking. 

Sometimes, apps download multiple files or folders they need to operate properly. You can dig through your file system and manually delete files, but that's a tedious process.

Find duplicates manually

You can, of course, just go through every folder, hidden or not, and delete the files that you remember seeing somewhere else. But how long would that take you? Your files love to spread throughout multiple destinations, and some apps like iTunes or Photos keep their own libraries of your files, which are hard to get to. 

Smart Folders can help. Your Mac lets you create Smart Folders inside Finder. These folders have automations to make finding file types easier. 

Here's how to use Smart Folders on Mac:

  1. Open Finder
  2. From the menu bar, select “File”
  3. Select “New Smart Folder”
  4. In the finder window, choose “Kind”
  5. Next to “Kind,” select the file type you want to isolate for the smart folder

    How to use Smart Folders to detect duplicates

This is Apple's imperfect method; it can help you find all types of files, but there's no automation for duplicates in Smart Folders. If you have multiple versions of a presentation, for example, Smart Folders can help you find all of your presentations, no matter where they're stored on your Mac. You can delete them in the Smart Folder, too, and those files will be placed in Trash.

Photos

You can also use Smart Folders to find duplicate images. Simply choose Kind > Image > and the type of image you want to find a duplicate of.

Downloads

Finder has a search field that can be handy for finding duplicate files. To use it for your Downloads folder, open Finder, and make sure you have the “Downloads” folder selected from the menu on the left side of the window. In the search bar on the top right, enter the name of a file you want to find a duplicate of. 

Mail downloads

Your mail downloads have a home on your Mac. Again, this is likely your downloads folder; to make sure, go to your mail app, select its name in the menu bar, and choose “Preferences.” In its preferences menu, it allows you to designate where you want your downloads to go.

Mail downloads folder

All you have to do form there is search the folder your mail downloads go to for duplicate files as noted above.

How to find duplicate files with a Terminal command

Before you start using Terminal, know this: any changes you make to Terminal and not reversible, and could have lasting effects on your Mac. Be careful!

To find duplicate files on Mac using Terminal, follow these steps:

  1. Open Terminal on your Mac
  2. Use the cd command to change directories.
    Note: If you have to change directories multiple times – say if you want to search a folder deeper in your file hierarchy – simply use the cd command multiple times until you reach your destination
  3. Enter this command: find . -size 20 \! -type d -exec cksum {} \; | sort | tee /tmp/f.tmp | cut -f 1,2 -d ' ' | uniq -d | grep -hif – /tmp/f.tmp > duplicates.txt
  4. Press 'Enter' on your Mac keyboard

    find duplicate files with a Terminal command

This creates a text file of all your duplicate files in the folder you're searching – but doesn't delete them! You still have to go looking for those files.

Get rid of duplicate files and folders with duplicate files finders

Just as with most maintenance tasks, finding duplicates has been automated for quite some time now. Apps like Gemini and Disk Drill are excellent duplicate file finder apps, able to scan your computer and clear out the excess completely in minutes.

Gemini is beyond easy to use. It's able to swiftly inspect your Mac, sort all the results by type or date, and even find similar files beyond just duplicates.

Get rid of duplicate files and folders gemini

When you launch the Gemini app, it will prompt you to add a folder to scan. This can be any folder on your Mac, including common folders like your Home folder, Pictures folder, and Music folder, where your iTunes library lives. You can also drag and drop folders onto the Gemini window.

After Gemini finishes the scan, it'll show you how many duplicates it found and recommend which ones to automatically delete. You can click the Smart Cleanup button to delete the files that Gemini suggests or click Review Results to see all the duplicate files and make your own decisions.
Gemini 2 duplicate files finder

The Review Results window contains everything you need to decide, too. For each duplicate file, you can see where each version lives on your hard drive when it was last modified, how large the file is, and of course preview it. The sidebar also distinguishes exact duplicates from files that are just very similar. You can sort any list by size or file type, and then check the boxes for any files you are comfortable deleting.

To see everything you have selected for deletion so far (including the choices Gemini made on your behalf), just click the Selected section in the left-hand sidebar. And when you're finished making selections, just click the Smart Cleanup button in the bottom-right and that's it! Gemini deletes your duplicate files and you're all done.

Disk Drill has similar functionality, and some extra features. The tool can recover deleted files that haven't been overwritten yet, salvage files from a corrupted external hard drive or SD card, and check the health of your main hard drive. Pretty useful, we think.
Find duplicates with Disk Drill Pro

When you launch the app, click the Find Duplicates feature in the toolbar and add a folder for the app to scan. Your Home folder is a good place to start.

After the scan, Disk Drill will show all the duplicate files it has found. You can click the arrow next to any to see all the locations on your hard drive where that file was found and choose the one to delete. You can click a little magnifying glass icon to open the file's location in the Finder or click the eyeball to preview the file with Quick Look.

The app doesn't automatically select any files to delete, but has a few handy features. The default view puts the largest files on top of the list, but you can re-sort that however, you like. If you select all versions of the same file to delete, Disk Drill highlights that file name in red as an extra visual warning that you're about to delete them all.

Once you've made all your selections, just click the Remove button at the top-right of the window, confirm that you're really deleting them, and, poof, they're gone.

Conclusion

Finding duplicate files on your Mac can be tedious without great apps. That's likely why your memory is filled with duplicate files. It's also why most of us don't bother finding the duplicates to delete!

Gemini and Disk Drill making finding duplicate files really simple. Both have awesome features, and make finding and deleting duplicate files a snap.

All these apps are also part of the Setapp collection. In fact, there are about 150+ more useful apps for your Mac. And with a free trial, you can try these tips and free up space on our dime.

Get 190+ Mac apps for any job

Sign up to Setapp and try them for free.