How to Find and Remove Duplicate Files on Mac

By Anders Smith

Friday, October 29, 2021

Posted on #Clean up

It’s a good habit to always keep things with a copy. Before editing a file or an image on Mac, many people press Command + D to duplicate the file and then make revisions to the copy. However, as the duplicated files mount up, it can disturb you because it makes your Mac short of storage or literally in a mess. So, this post aims at helping you out of this trouble and guides you to find and remove duplicate files on Mac.

See also:

How to Find and Remove Duplicate Photos on Mac

De-duplicate Music Files in MacBook Air/Pro

Why Do You Have Duplicate Files on Mac?

Before taking action in removing duplicate files, let’s go through some common situations that you are likely to have accumulated numbers of duplicate files:

  • You always make a copy before you edit a file or an image, but do not delete the original one even if you no longer need it.

  • You move a patch of images into your Mac and view them with the Photos app. Actually, these photos have two copies: one in the folder that they are moved into, the others are in Photos Library.

  • You usually preview the email attachments before downloading the files. However, once you open an attachment, the Mail app has automatically downloaded a copy of the file. So you get two copies of the attachment if you manually download the file.

  • You download a photo or file twice without noticing it. There will be "(1)" in the file name of the duplicate.

  • You have moved some files to a new location or an external drive but forget to delete the original copies.

As you see, things often happen that you have got multiple duplicate files on your Mac. In order to get rid of them, you have to take some methods.

A Quick Way to Find and Remove Duplicate Files on Mac

If you already suffer from duplicate files on your Mac, you may want to solve the problem as quickly as possible. So in the first place, we would recommend you to use a reliable duplicate file finder for Mac to finish this job, for example, Macube Cleaner. It can help you locate and remove duplicate photos, songs, documents, and other files on your Mac in simple clicks, and will immensely save your time. It’s totally safe and easy to use. Look at the following steps to get a grip on how to use it.

Step 1. Free Download Macube Cleaner

Step 2. Launch Macube Cleaner to Find Duplicate Files

On the main interface, you can see the System Status of your Mac clearly. On the left column, you can choose the data types to clean, such as large & old files and uninstallers. Select Duplicate Finder to find and clean duplicate items on Mac.

Open Macube Cleaner

Step 3. Start Scanning Duplicate Files on Mac

After selecting Duplicate Finder from the left sidebar, Macube Cleaner supports users to scan specific folders, so click Choose Path and select the desired folder to open. Then, click the Scan tab to get started.

Start Scanning Duplicate Files

Step 4. Preview and Remove Duplicate Files

When the scanning process completes, all the duplicate files will be listed on the interface and are classified into categories.

View Duplicate Files by Category

Click the small triangle beside each duplicate file to preview the duplicate items. Choose the duplicate files you want to delete and hit Clean to delete them. A lot of space must be freed up!

Cleaning Complete

Note:

You can preview the photos, videos, songs, etc. beforehand to avoid mistaken deletion. Because the duplicate files are mostly identified by names, double check before removing them is always recommended.

Find and Remove Duplicate Files on Mac with Smart Folder

Using the Mac built-in features to locate and remove duplicate files is also an available way, though it will cost a bit more time. One of the ways is to create smart folders to find out duplicate files and clear them up.

What’s Smart Folder?

The Smart Folder on Mac is not actually a folder but a search result on your Mac that can be saved. With this function, you can sort out the files on Mac by setting up filters like file type, name, last opened date, and etc., so that you can easily access and manage the files you have found out.

How to Find and Remove Duplicate Files with Smart Folder

Now that you know how the Smart Folder on Mac works, let’s create one to locate and remove duplicate files.

Step 1. Open Finder, and then click File > New Smart Folder.

Create New Smart Folder

Step 2. Hit the “+” at the top right corner to create a new Smart Folder.

New Smart Folder Interface

Step 3. Set up filters to categorize the possible duplicate files.

At the drop-down menu below “Search”, you can enter different conditions to sort out your files.

For example, if you want to access all the PDF files on your Mac, you can select “Kind” for the first condition and “PDF” for the second one. Here’s the result:

Finding PDFs in New Smart Folder

Or you want to get all the files that contain the same keyword, for example, macube. This time you can select “Name”, choose “contains” and finally enter “macube” to get the results.

Sort by Name in Smart Folder

Step 4. Arrange the files by Name and then delete the duplicate ones.

As you have got the search results, you can now hit “Save” at the right top corner to save the Smart Folder and begin to tidy up the files.

Because the duplicate files are usually named the same as the original ones, you can right-click to arrange the files by their names to find and remove the duplicates.

Sort by Name

Find and Remove Duplicate Files on Mac with Terminal

Another way to manually find and get rid of duplicate files on Mac is to use Terminal. By using Terminal command, you can detect duplicate files more quickly than searching one by one by yourself. However, this method is NOT for those have barely used Terminal before, for it might mess up your Mac OS X/macOS if you enter a wrong command.

Now, follow the steps below to know how to find duplicate files on Mac:

Step 1. Open Finder and type terminal to bring out Terminal tool.

Step 2. Choose a folder that you would like to clean duplicates and locate the folder with cd command in Terminal.

For example, to search duplicate files in Downloads folder, you can type: cd ~/Downloads and click Enter.

Step 3. Copy the following command in Terminal and hit Enter.

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

Step 4. A txt. file named duplicate will be created in the folder that you have chosen, which lists out duplicate files in the folder. You can find and delete the duplicates manually according to the txt. file.

Find Duplicates with Terminal

Noted that there are also some downsides:

  • Searching duplicate files with Terminal in Mac is not totally accurate. Some duplicate files cannot be found by Terminal command.

  • With the search result provided by Terminal, you still need to manually locate the duplicate files and delete them one by one. It is still not clever enough.

Conclusion

Above we have provided three ways for how to find and remove duplicate files on Mac. Let’s review them once:

Method 1 is to use Macube Cleaner, a third-party tool to automatically locate and clean up duplicate files. The advantage of it is that it can cover all kinds of duplicates, is easy to use, and time-saving.

Method 2 is to create Smart Folders on your Mac. It’s official and can be a great way to manage the files on your Mac. But it requires more time, and you may leave out some duplicate files because you have to sort them out by yourself.

Method 3 is to use Terminal Demand on Mac. It’s also official and free, but is hard to use for many people. Also, you need to manually identify the duplicate files and delete them.

Considering the usage, Macube Cleaner is the best recommendation, but each one is a viable way and you can choose according to your need. If you have any concerns, feel free to reach us!

avator
Our Writer
Anders Smith, the chief editor of Macube team, is a big fan of Apple. He likes to share his experience and ideas through writing.