Forum Discussion

Yarisyoyo's avatar
Yarisyoyo
Iron Contributor
Feb 18, 2025

How to Effectively Find and Delete Duplicate Files on Mac?

Hi everyone,

There are over 5K photos and images screenshots on my MacBook Pro. Now, the available storage is on 5GB. I noticed that there are a lot of duplicate photos taking up unnecessary space. Since I use a Mac, I'm looking for a way to efficiently find and delete these duplicates without losing any important photos.

Could anyone recommend a reliable method to help me delete duplicate files on Mac? I'd prefer something user-friendly and safe, as I don't want to accidentally delete the wrong files.

Here's what I’ve tried so far:

  1. Manually scrolling through my photos to find duplicates (way too time-consuming).
  2. Using the built-in file explorer, but it doesn't seem to detect duplicates effectively.

Any advice or step-by-step guides would be greatly appreciated! Thanks in advance for your help!

7 Replies

  • CharlenFlow's avatar
    CharlenFlow
    Copper Contributor

    It is interesting to ask how to delete duplicate files on Mac in the Microsoft community.

    Manually comparing and deleting files can be time-consuming, so the most efficient solution is to use a duplicate file finder for Mac. These tools can quickly identify duplicate files, allowing you to select and delete them easily. This approach will save you valuable time and streamline your file management.

    However, to avoid deletion by mistake, some manual check is necessary as well. 

  • Facensp's avatar
    Facensp
    Iron Contributor

    If you prefer using the command line to find and delete duplicate files on your Mac, you can use a combination of terminal commands and scripting. Below is a step-by-step guide to help you achieve this:

    Step 1: Use the cd command to navigate to the folder where you want to search for duplicates. This will take you to the Documents folder. Replace ~/Documents with the path to the folder you want to scan.

    Step 2: You can use the find and md5 commands to fina and delete duplicate files on Mac based on their content (MD5 hash). Here's a script to do this:

    #!/bin/bash
    
    # Directory to search (change this to your target directory)
    DIRECTORY="."
    
    # Create a temporary file to store MD5 hashes
    TMP_FILE=$(mktemp)
    
    # Find all files in the directory, calculate their MD5 hashes, and store in the temp file
    find "$DIRECTORY" -type f -exec md5 {} \; | sort > "$TMP_FILE"
    
    # Identify duplicates by comparing MD5 hashes
    awk '{
        if ($1 == prev_hash) {
            print "Duplicate found: " $2 " and " prev_file
        }
        prev_hash = $1
        prev_file = $2
    }' "$TMP_FILE"
    
    # Clean up the temporary file
    rm "$TMP_FILE"

    This script will list all duplicate files in the specified directory based on their MD5 hash. Once you've identified the duplicates, you can manually delete them using the rm command. 

    P.S. If you're confident and want to automate the deletion of duplicates, you can modify the script to delete duplicates automatically.

  • MillerVance's avatar
    MillerVance
    Iron Contributor

    If you are a command line lover, there are also some ways to find and delete duplicate files on Mac through the command line. These methods may not be as intuitive as graphical tools, but they are flexible, fast, and can help you save storage space.

    Find duplicate files with fdupes
    fdupes is a very practical command line tool for finding and deleting duplicate files on Mac. It can scan duplicate files in a specified folder and provide you with the option to delete them.

    1. Open Terminal and install fdupes through Homebrew:

    brew install fdupes

    2.  After installation, use the following command to scan duplicate files in a folder:

    fdupes -r /path/to/directory

    Where the -r parameter means recursive scanning of folders and their subfolders.

    If you are sure you want to delete duplicate files, you can use the following command:

    fdupes -dN /path/to/directory


    -d means deleting duplicate files, -N automatically selects the first file to keep and deletes the rest.

    Advantages:

    • Completely free and powerful.
    • Supports recursive scanning, which can handle duplicate files in subfolders.
    • Can help you find and delete duplicate files on Mac.

    Disadvantages:
    Requires command line operation, which may not be user-friendly for some users.
    Be careful when deleting files. It is recommended to use the -r command to check duplicate files first to avoid accidental deletion.

  • Sofiamilll's avatar
    Sofiamilll
    Iron Contributor

    Duplicate File Finder is a user-friendly software tool designed to help Mac users efficiently locate and remove duplicate files from their system. It scans your Mac for duplicate documents, photos, videos, music, and other files, freeing up valuable storage space and improving system performance.

    How to find and delete duplicate files on macOS:

    1. Open Duplicate File Finder and select the folders or drives you want to scan.
    2. Click the Scan for Duplicates button to begin the process.
    3. Wait for the scan to complete (this may take a few minutes depending on the size of your storage).
    4. Once the scan is complete, review the list of duplicate files. Use the preview feature to check files before deletion.
    5. Select the files you want to remove and click Delete Selected. The files will be moved to the Trash, where you can permanently delete them.

    Why Use this Duplicate File Finder on Mac?

    1. Saves Time: Automates the process of finding duplicates, saving you hours of manual work.
    2. Frees Up Space: Helps you reclaim storage by removing unnecessary duplicate files.
    3. Prevents Clutter: Keeps your Mac organized and improves overall system performance.

    If you're looking for a reliable and easy-to-use tool to clean up your Mac, Duplicate File Finder is a great option! Let me know if you have any questions about using it. 

  • Tomilsonw's avatar
    Tomilsonw
    Iron Contributor

    If you don't want to use third-party tools to delete duplicate photos or files, you can use some built-in Mac functions to find and delete duplicate files on Mac. Although these methods may not be as efficient as specialized tools, they can still help you clean up some duplicate files and save storage space.

    1. Use the built-in "Photos" app on Mac
    The Photos app is the default tool for processing pictures on Mac. Although it does not have a direct "Delete Duplicate Photos" function, you can reduce duplicate photos through some manual operations.

    1. Open the "Photos" app and enter your photo library.
    2. Select "Photos" or the album you want to view on the left.
    3. Use Naming Rules and Time Sorting to help you filter out similar photos.
    4. Manually find duplicate photos and delete them.

     

    2. Use Finder to find and delete duplicate files on Mac (manual method)
    Although Finder does not have the function of automatically identifying duplicate files, you can manually find and delete duplicate files on Mac with some search techniques and sorting functions.

    1. Open Finder and enter the folder where you store photos.
    2. Enter common file names (such as IMG, screenshot, etc.) in the Finder search box to see if there are duplicate files.
    3. You can sort files by name, date or size to manually filter out duplicate photos.
    4. Select the duplicate files and press Command + Delete to delete them.

    Advantages:
    No need to install additional software, completely rely on the system's built-in tools.
    You can control the deleted files to avoid accidental deletion.

     

    3. Use "Storage Management" to clean up space
    Although the Mac's Storage Management function cannot directly delete duplicate photos, it can help you identify which files take up a lot of space, thereby helping you clean up unnecessary files.

    1. Click the Apple menu and select "About This Mac".
    2. Click "Storage" and then select "Manage".
    3. In the "Storage Management" interface, select options such as "Photos" or "Documents" to see which files take up the most space.
    4. If you find that there are unnecessary photos or files that take up a lot of storage, you can delete them manually.

    Advantages:
    Convenient and fast, the system comes with a cleanup tool.
    It can help you identify large files, not just duplicate files.
    Disadvantages:
    It cannot automatically delete duplicate files and needs to be filtered manually.

  • BhevesY's avatar
    BhevesY
    Iron Contributor

    DupeGuru is a popular option. It is available for free. You can choose the folders or drives you want to scan. DupeGuru scans for duplicates based on their content, names, or similar names and provides a list of detected duplicates. You can customize your search criteria to match different scenarios. It allows you to easily preview and delete duplicate files on mac.


    Pros: Free and open-source, highly customizable, efficient.
    Cons: Interface may be less polished than paid options.

    The Mac Finder has a built-in search function, but it is not as good as a dedicated app at finding duplicate photos, especially if the photo file names are different. It's also not as easy to use for previewing files. However, it can be useful to find duplicate files with the same name. You can create "Smart Folders" in Finder to search for files with the same name or of a certain type.

    • Open Finder.
    • Go to "File" > "New Smart Folder" (or press Option + Command + N).
    • In the search bar at the top right, type in the file type you are looking for, such as "jpg" or "png".
    • Click the "+" button to add search criteria. You can search by "Name", "File Size", "Date Created", etc. to try and find duplicates.

Resources