How to find and remove duplicate files on a Mac

51.8K views
7 min read

Duplicates are identical files of any format: documents, music, images, videos, etc. They can be located in the same or different folders, which means they take up space on your computer and can slow down its performance. So it’s better to get rid of identical files. You can do it automatically and quickly with the help of dedicated apps or manually but slower. 

In this article, we'll show you how to delete duplicate files on Mac in different ways.


Why does my Mac duplicate files?

In fact, the presence of duplicates is a common thing when working on any computer. 

Here are the main reasons for their appearance:

  • You downloaded a file by mistake several times because you accidentally clicked on a link several times. You dragged a file to your desktop, creating a copy. The email attachment was downloaded multiple times on separate occasions. You deliberately created multiple backups of the same file and placed them in different folders.
  • iTunes contains different versions of the same song (for example, because it's a part of different albums you've downloaded).
  • You have identical playlists because you synchronize your iPhone, iPod, or iPad with multiple laptops.

Even if you're a careful user, duplicates will most likely still appear, and that's okay. The main thing is to clean them up in time.

Easiest ways to find and remove duplicate files on your Mac

The easiest way to get rid of duplicates is to use Gemini. This is an app that scans your disks and smartly selects files for deletion. Files that Gemini is sure are similar are marked as recommended for deletion. If the app thinks you might want to keep files for some reason, it will offer you to preview them in a user-friendly interface and then group, select, and get rid of them all with one click.

Gemini searches not only for identical files but also for similar ones (for example, photos that were taken from the same angle and place).

As you interact with the app, it autonomously learns and organizes files based on your behavior during subsequent scans.

To find duplicate files on Mac, follow the instructions below:

  1. Install and open Gemini
  2. Add or select a folder to scan by clicking on the + sign
  3. Click Scan for Duplicates and wait for the scan to complete. If the file size is large, it may require additional time to complete the process
  4. Click Review Results and select what you want to remove.

gemini duplicate finder

In the background, Gemini will constantly check for new duplicates, and if there are any, it will notify you with a pop-up.

Another program that will clear your Mac of identical files is Disk Drill. It can also recover lost files and analyze disk space, but today, we'll focus on "twins."

  1. Install and open Disk Drill
  2. On the left side menu, select Find Duplicates
  3. Drag and drop the folder to be scanned or specify the path to the folder where you want to find identical files
  4. Click Start Scan
  5. Select and remove duplicate files.

delete duplicates from mac disk drill

All the duplicates you delete won't disappear immediately. They'll end up in the Recently Deleted folder and take up space on your disk. Empty this folder to get rid of them permanently and free up space.

And if you delete any of them by mistake, you can always use DiskDrill to recover them.

How to find duplicate files using Terminal

Although Terminal will display duplicates, there is a possibility that it may overlook some of them. Moreover, you can't delete files directly from Terminal. You'll have to manually sift through them, separating the duplicates from the original, and it can take hours if there are a lot of copies. This approach is better suited for getting a general overview of the presence or absence of "twins" on your laptop.

Here’s how to find duplicates on a Mac using Terminal:

  1. Open Terminal. In the Finder, choose Go > Utilities > Terminal
  2. Type in the path to the folder you want to check, e.g.,: cd Desktop > Enter
  3. Then type in the command: find ./ -type f -exec md5 {} \; | awk -F '=' '{print $2 "\t" $1}' | sort | tee duplicates.txt > Enter
  4. find duplicates through terminal

  5. This command will generate a list of all identical files and create a duplicates.txt document in the folder you scanned (in our case, Desktop).

remove duplicates with terminal

If you can't find the document, type "duplicates.txt" using the Spotlight. Now, you have to search for each file individually and make a decision whether to delete it or not.

Find duplicate files using Smart folders

Smart folders are another manual way to find and remove duplicate files Mac.

  1. Click File in Mac's top panel > New Smart Folder

  2. smart folders to find and remove duplicates

  3. Click the + sign and choose the type of files you want to display

  4. smart folders on mac to sort files

  5. Use the + button to add new filters to the selected files (created date, name, etc.)

smart folders to find similar files

Now comes the not-so-fun part: you have to check the files (i.e., open each one individually) for the same name, size, or other parameters and delete the ones you don't need. Can this take hours of your time? Absolutely. Is there an easier way to reconcile files? Definitely.

Check out the DefaultFolder X app. It's not designed strictly for finding identical files, but it can lead you to any path from any point. Basically, this app is a sidebar that appears whenever you come across the Open/Save dialog box. From there, you can easily navigate from folder to folder and open your favorites or recent ones. This can help you get to the source of duplicates and quickly delete them.

defaultfolder x sort files

Check for duplicate pictures in your Photos library

Macs running with macOS Ventura now have an automatic duplicate search function. It groups identical or similar files that differ in certain details (extension, date, location, tags, etc.) and offers to merge them. To do this, follow this path:

  1. In the Photos app on your Mac, click Duplicates in the sidebar
  2. Then Merge Duplicates. 

built in duplicate remover macos ventura

You need to manually check each group and decide whether you want to merge it. Photos of poorer resolution are moved to Recently deleted for 30 days. They'll continue to take up space, so empty this folder if you're sure you don't need them.

If your photos are stored in both the Photos app and some other folders, you can match them in a fairly simple way.

  1. Select all the photos in the other folder and drag them to Photos
  2. The app will ask if you want to import duplicates. If not, check "Apply to all duplicates" and then "Don't import"
  3. After that, you can delete all the files from the initial folder, since the original ones have already been moved to the Photo Library, and the duplicate ones have not been copied. 

Tip: Does your Mac feel sluggish and slow? Don't worry, there's a game changer called CleanMyMac X that can make a big difference. While it doesn't directly remove duplicates, it's a fantastic tool for boosting your Mac's speed and efficiency. Picture this: CleanMyMac X takes a deep dive into your system and finds all those unnecessary files, caches, and logs that are just clogging things up. It sweeps them away, freeing up valuable space and giving your Mac a new lease on life. Say goodbye to lag and hello to a lightning-fast machine with CleanMyMac X as your cleanup superhero.

How to find duplicates in Mail Downloads

If you use Apple Mail, you may need to clean up your downloads. Why are there duplicates? When you download an attachment, it is saved to your computer. But Mail also downloads the attachment to its own folder as soon as you open the email. This is how "twin" attachments are created. To find them, do the following:

  1. Open the Finder
  2. Press Shift + Command + G to open the Go to Folder search field
  3. Type ~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads and click Go.

You will see a folder with your downloads, and you can safely clear it. They are stored here to improve your experience, so that the next time you use the file, it opens faster. All attachments will continue to be stored in the cloud on your email, so you won't lose anything if you clear this folder.

Removing duplicates made easy with Setapp apps

Creating "twin" files is a common thing that happens when you use a laptop. In some cases, duplicates can clutter up space, so you should get rid of them. Otherwise, you'll get lost in your files, and your Mac may slow down.

You can clean up identical files on your Mac manually or with apps.

Manual methods include using Terminal, smart folders, searching for duplicates in the Photo Library, and mail downloads. In all cases (except for mail downloads), you'll have to open each file individually, compare them with each other, and make a decision about deleting them. It can take several hours to do this, without exaggeration.

Gemini and Disk Drill automate this process. You simply select the folder you want to check and click on Go or Scan. Both apps display all duplicate and similar files in a convenient format and allow you to delete them in a handy way without opening each file separately. 

On top of that, we recommend you include CleanMyMac X in your Mac cleanup routing to speed your machine up.

These three apps, along with dozens of others, are available on the Setapp platform under one subscription. With Setapp, you don't need to waste your time looking for apps, comparing prices, or worrying about compatibility issues. You can focus on your work and let the platform take care of the rest. You can try Setapp tools for free for 7 days, then pay $9.99/mo. It’s a reasonable price for 240+ apps to tackle almost any task on your Mac, iPhone, and iPad. Try it today and see for yourself how it transforms the way you work and live.


240+ apps for $9.99
per month

Sign up to Setapp and try them for free.

Security-tested