The chances are that when you create a file it will end up in several places on your Mac. This is not just annoying but hinders your device performance as pretty soon storage space will fill up. Macs don’t have an infinite amount of storage after all.

As such, it is important for a better Mac life to Finding and deleting duplicate files on a mac. You can find more information as to how and why you create duplicate files here.

Why Are My Mac Files Being Duplicated?

Finding and Deleting Duplicate Files on a Mac

File duplication can happen for a variety of reasons. Importing photos that were already in iCloud could be one reason, perhaps you couldn’t find a downloaded document so downloaded it again. The simple fact is duplicate files happen due to the nature of computing.

The problem is as these files duplicate, especially large files, storage space begins to run out. Given all the other things that can eat into this valuable resource, it becomes a very good practice to clear out duplicates to avoid performance issues with your Mac.

There are a number of ways to find duplicate files so let’s look at these in more depth.

Use Terminal to Find Duplicate Files

Terminal is a powerful tool that should only be used with caution. A wrong move could cause serious issues with you using Mac and you don’t want that. Presuming you’re familiar with Terminal, here’s what to do next!

  • Go Finder, Applications, Utilities, Terminal
  • Use the cd command to navigate to the folder you want to scan. So to scan Downloads you would type cd ~/Downloads. Press enter.
  • Copy/paste the following: 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 – Press enter.

At this point, Terminal creates a text file that has the duplicates inside. However, it is up to you to locate the duplicates, and Terminal doesn’t always find every duplicate file which is annoying. The reason Terminal doesn’t find everything, is that each file has an md5 hash which gives every file a unique identifier.

To get around this, use Terminal in the following way:

  • Open Terminaland go to Downloads or a different folder as outlined above.
  • Copy/Paste find ./ -type f -exec md5 {} \; | awk -F ‘=’ ‘{print $2 “\t” $1}’ | sort | tee duplicates.txt – Press Enter.
  • Open Finder, Downloads (Or the folder you chose).
  • Open the text file.

Now you’ll be able to see the md5 hash and be better able to identify which files are duplicates of each other. You can now manually delete the files.

Smart Folders

Finding and Deleting Duplicate Files on a Mac

So using Terminal can be effective in finding duplicate files on a Mac. The issue is that they can live anywhere on your device, not just in one folder.

This is where Smart Folders can help you out.

  • Go Finder, File, New Smart Folder and make sure This Mac is selected.
  • Click + in the top right corner.
  • In the first drop-down select Kind. Second drop-down select Documents. Save this.
  • In the pop-up window choose a location to save your Smart Folder.
  • A list of documents will appear. You can sort by name, date, etc so finding duplicates is easier.
  • Delete files that are duplicates.

Again it is time-consuming but it is effective.

Deleting Duplicate Photos

Every time you import photos it uploads to two locations. The location where you choose to import your photos to, and also to your Photo Library as well.

So the obvious thing to do is to delete all your photos from the Photo Library. That’s fine as long you know that you don’t want them.

If you do know they are find similar images, delete them. They will be moved to Recently Deleted folder so delete them again to purge them from your device.

Finding Duplicate Pictures in Photos

Finding and Deleting Duplicate Files on a Mac

If you’re using Photos to store and organize your pictures, you’re only seeing images that are stored in Photos Library. Duplicates stored in other locations won’t be displayed. To find them go:

  • Photos, Photos tab. Your pictures should be sorted by date.
  • Finder, All My Files. You’ll now see all your pictures in bulk. Sort files by Date Created.
  • Compare the dates between All My Files and Photosand spot duplicates. Delete the ones that are stored outside of Photos Library.

Final Thoughts

Macs are great machines but due to the nature of computing, it is very easy to duplicate files. In fact, it happens automatically. As such, it is important to keep your Mac maintained. At the end of the day, a well-maintained Mac is a happy Mac, and you’ll have a better computing experience as a result.

In case you missed it!

loader