Forum Discussion
Is there any good duplicate file finder on Mac?
A duplicate file finder is a tool that helps identify and remove duplicate files on your computer. These tools scan directories and compare files based on different criteria such as name, size, or checksum to detect duplicates. Removing duplicates helps free up disk space and organize files efficiently.
You can use built-in command-line tools like find, md5, sha256sum, or fdupes to locate duplicate files in macOS. Now, generate checksums (unique file signatures) and look for duplicates.
Open Terminal. Navigate to the directory you want to scan. Run the following command to list duplicate files based on MD5 checksums:
find . -type f -exec md5 {} + | sort | uniq -w 32 -d
This calculates the MD5 hash of all files in the directory. It then sorts the results and removes unique entries, leaving only duplicates. To get a list of duplicate file paths:
find . -type f -exec md5 {} + | sort | uniq -w 32 -d | awk '{print $2}'
In addition, you can used a third-party duplicate file finder for macOS called fdupes, a dedicated command-line tool for finding and deleting duplicate files.
brew install fdupes
fdupes -r /path/to/your/folder
fdupes -r /path/to/your/folder
fdupes -rd /path/to/your/folder
These two methods efficiently help find duplicate files on macOS via the terminal. Let me know if you need more help on this.