How to Find and Delete Duplicate Files on Mac (Step-By-Step)
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 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.
Here's how to find and delete duplicates on Mac with BuhoCleaner:
- Download, install, and launch BuhoCleaner.
- Click "Duplicates" in the sidebar, then click the "+" button to choose a folder or drive to scan.
- After scanning, you can see that the duplicate files are divided into categories such as images, documents, archives, and other files.
- Preview the duplicate files and delete the ones you don't need.
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:
- Click the "File" menu in Finder and choose "New Smart Folder".
- Click the "+" button in the upper right corner.
- From the first drop-down menu, select "Kind". Then from the second drop-down menu, select the desired file type.
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.
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.
Open Terminal via Spotlight.
Run the cd command to navigate to the folder you want to scan, for example
cd ~/Desktop
.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
+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 10 MB) and +1G
(files larger than 1 GB).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.
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:
Open Terminal.
Run the cd command to go to the folder you want to scan, for example:
cd ~/Desktop
.Continue to run the following command:
find . -type f -exec md5 {} \; | awk -F '=' '{print $2 "\t" $1}' | sort | tee duplicate_files.txt
Wait for the script to finish running, and you will find the md5 hash and path of every file.
Go to Finder and manually locate the files and delete duplicate ones.
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?
Wendy Wu is a tech enthusiast with a deep passion for all things iPhone, iPad, and Mac. Wendy is always on the lookout for Apple products and is committed to providing Apple users with some of the latest information and useful tips.