How to Delete Duplicate Files on Mac

This post was published on the now-closed HuffPost Contributor platform. Contributors control their own work and posted freely to our site. If you need to flag this entry as abusive, send us an email.

We have all been there: no disk space at all when we desperately need some to save really important stuff. Yes, that cute autumnal selfie-session with a knitted scarf was important, whatever Insta-hating buzzkills might say. The most annoying thing? You do not have that many files on your Mac. Not the bulky ones, anyway. The days when you stored your entire media library on a hard drive are gone for good. You know what the cloud and streaming services are for, right? What is taking up the disk space then?

That might not be evident at once, but the most likely culprits are duplicate files. Yes, doppelgangers are evil not only in Twin Peaks. Getting rid of those pesky twins is important for several reasons. First, you will free some space on your disk, which is always good news. As a very nice bonus, your Mac might run a bit faster. Clutter and lack of free space can slow your machine down.

Luckily, you do not have to go through all of your folders hunting for duplicates manually. It is actually as easy as pie. You can use an app that will find duplicate files in your Mac and all you have to do is to decide which ones you are going to trash.

Alternatively, if you feel like DIY today, there is a number of ways that you can tackle this double trouble.

The laziest way to find duplicate music files on your Mac is through the iTunes app. iTunes is a versatile tool designed to play, download and manage your media. Therefore, no wonder it has a designated menu item for duplicates. Click File > Library, then select “Show Duplicate Items”. That’s it. You have them before you. However, this will show you the files with the same name. If you fiddle with MP3 clips for creative purposes, you may find that list contains different versions of a file saved under the same title.

Alternatively, if you need to narrow your search to exact copies of the same file, you can hold the Option key and select the “Show Exact Duplicate Items”. Thus, you will restrict the list to files, which are true doubles. Either way, you will see an organized list of files, but to choose which ones to delete is up to you.

Although iTunes is restricted to your media library, you should not ignore this handy way to manage the duplicates on your Mac. After all, media files are the bulkiest items that gobble up space on your drive. Moreover, the app is always there, so it is an easy, native and trouble-free way, even if not the most thorough.

Hate to break this news to you, but sadly, there is no similar handy option in the Photos app (nor was there in iPhoto previously). You will have to detect duplicate photos with your own eyes and sound judgment. After all, no algorithm can detect better than you which picture is the best. Once you have identified the winner, you may get rid of the rest. Seriously, if that Frappuccino snap wasn’t good enough to post, why on earth would you want to keep five failed attempts on your Mac?

Another ridiculously easy way (and quite popular too) is to search duplicates via Finder. To do that, open a new Finder window and type an asterisk symbol (*) into the Search menu. That is the one in the left upper corner with the magnifying glass icon, in case you never used it before. Make sure you have both Size and Kind columns enabled. If you don’t see them, click View, then Show View Options, and add them. Once they are displayed, you can choose to sort the list by Size in case you want to get rid of the largest files without further ado.

However, be careful to check and double-check the file before deleting it to avoid frustration and disappointment. Go and open it, if you must. File names and sizes aren’t always enough to be positive that this one is for keeps and that one is for the trash. Sometimes you have to look at the content.

That should actually say “for folder by folder search”, but you know what I mean. Using Terminal and command strings is not something an average Mac owner does on a daily basis. After all, that is why one gets a Mac in the first place – not to do weird computer stuff. However, it can be useful, if you need a list of duplicate files in a particularly large folder. Brace yourself and follow these instructions precisely, otherwise you risk messing things up, bit time.

- Open Terminal and enter cd ~ followed by the name of the folder you want to check for duplicates (for example, cd ~/Documents) and press “Enter”.

- This one is important: copy and paste the following text into the Terminal: find . -size 20 \! -type d -exec cksum {} \; | sort | tee /tmp/f.tmp | cut -f 1,2 -d ‘ ‘ | uniq -d | grep -hif – /tmp/f.tmp> duplicate.txt

- Now you have a text file titled duplicate.txt generated inside the folder you were inspecting and listing the duplicates. Having those named makes it easier by far to get rid of them. However, you still have to delete them manually one by one.

Voila, now you can impress your friends with this little trick!

Multiple downloads of the same file, backups, files you saved in different places – they all become duplicates that are nothing but a waste of disk space. Luckily, now you know how to get rid of them. It is a finicky job, but it is worth it.

Note that moving your duplicate files to Trash does not free your disk space per se. You should empty Trash manually or set up your Mac to empty it automatically (this option became available in macOS Sierra).

Popular in the Community