How to Find and Delete Duplicate Files on Mac - 3 Ways

Sarahi Johns
Last updated: Jan 25, 2024
Summary: This article will guide you on three ways to find and delete duplicate files on your Mac. Keep reading to discover what they are.

If you've been using your Mac for a while, chances are you've accumulated a lot of duplicate photos, songs, documents, and other files without even knowing it. These duplicate files can take up a lot of space on your Mac. If you're running out of storage space, removing these duplicates can free up some disk space for you.

Read this blog to learn how to use BuhoCleaner, Finder Smart Folders, and Terminal to find and delete duplicate files from your Mac.

How to Find and Delete Duplicate Files on Mac

Method 1. How to Find and Delete Duplicate Files on Mac Using BuhoCleaner

The easiest way to find duplicate files on your Mac is by using a duplicate file finder, and BuhoCleaner is the tool you need. Its "Duplicates" feature allows you to quickly locate and delete all duplicate files in a selected folder or drive.

DownloadFor macOS 10.10 and above
100,000+ Satisfied Users Worldwide
  1. Download, install, and launch BuhoCleaner.
  2. Click "Duplicates" in the sidebar, then click the "+" button to choose a folder or drive to scan.
    Duplicate File Finder - BuhoCleaner
  3. After scanning, you can see that the duplicate files are divided into categories such as images, documents, archives, and other files.
  4. Preview the duplicate files and delete the ones you don't need.
    Find and Delete Duplicate Files on Mac with BuhoCleaner
Tip
You can also use BuhoCleaner to find similar photos on your Mac, cloud drives and external drives.

Method 2. How to Find and Remove Duplicate Files on Mac Using Finder Smart Folders

If you prefer not to install any software on your Mac, you can use Finder's built-in duplicate file finder, Smart Folder, to manually locate and remove unwanted duplicate files.

Here's what you can do:

  1. Click the "File" menu in Finder and choose "New Smart Folder".

    Open New Smart Folder
  2. Click the "+" button in the upper right corner.

    New Smart Folder
  3. From the first drop-down menu, select "Kind". Then from the second drop-down menu, select the desired file type.

    Manually Find Duplicate Files on Mac
  4. Sort the files in the result list by size or name to check for duplicates. If there are, preview and delete the one you don't want.

Method 3. How to Find and Delete Duplicate Files on Mac Using Terminal

Another way to search for duplicate files on a Mac is to use Terminal, a powerful tool built into macOS. If you know Mac very well or are familiar with complex commands, follow these steps to find duplicates on your Mac.

  1. Open Terminal via Spotlight.

  2. Run the cd command to navigate to the folder you want to scan, for example cd ~/Desktop.

  3. Paste the command below into Terminal and press Return.

    find . -size +100 ! -type d -exec cksum {} \; | tee /tmp/f.tmp | cut -f 1,2 -d ' ' | sort | uniq -d | grep -hif - /tmp/f.tmp > duplicate_files.txt

Find and Delete Duplicate Files with Terminal
Tip
The +100 in the command means to find files larger than 100 bytes. You can replace it with other numbers you like, such as +10M (files larger than 10MB) and +1G (files larger than 1GB).

This command will create a .txt file on your desktop. What you need to do is open the .txt file and manually find and delete the duplicate files.

Find Duplicate Files with Terminal

As you can see, manually locating and removing all the duplicates in the .txt file is quite time-consuming. Luckily, every file has an md5 hash that doesn't change even if you move or rename the file. So you can use the md5 hash of the files to easily tell if they are duplicates or not.

Here's how:

  1. Open Terminal.

  2. Run the cd command to go to the folder you want to scan, for example: cd ~/Desktop.

  3. Continue to run the following command:

    find . -type f -exec md5 {} \; | awk -F '=' '{print $2 "\t" $1}' | sort | tee duplicate_files.txt

  4. Wait for the script to finish running, and you will find the md5 hash and path of every file.

  5. Go to Finder and manually locate the files and delete duplicate ones.

Find Duplicate Files with md5 hash

Bonus: Why Are There Duplicate Files on Your Mac?

Duplicate files can be created in many situations, such as:

  • Downloading the same file more than once.
  • Accidentally copying files.
  • Importing the same photo from different devices.
  • Attachments to emails and messages.

The Bottom Line

Now that you've learned about three methods to locate and remove unwanted duplicate files from your Mac, it's clear that BuhoCleaner can save you a significant amount of time and effort. Why not give it a try and experience the benefits for yourself?

Sarahi Johns

I'm Sarahi Johns, a tech enthusiast with a deep passion for all things iPhone, iPad and Mac. With expertise in crafting engaging tech content, I've authored numerous articles in the past 10 years, making me a trusted source for Apple enthusiasts.