There are tons of free and paid apps available for Mac to identify duplicate files and clean them, but do you know you can identify and delete duplicate files easily using the Mac Terminal, all you need is a package called fdupes
You can download this package using brew
brew install fdupes
GitHub: https://github.com/adrianlopezroche/fdupes
Example: Find all duplicates in the Downloads folder% fdupes -r -S Downloads
2513563 bytes each:
Downloads/mysql-connector-java-8.0.30/mysql-connector-java-8.0.30.jar
Downloads/mysql-connector-java-8.0.30.jar
1113 bytes each:
Downloads/2020101_Image.png
Downloads/temp.png
24958 bytes each:
Downloads/college-trip.mp4
Downloads/college-trip-copy.mp4
As you can see, I was able to get duplicate files - Images, Software, and Videos with the size they occupy!
Few useful options-r --recurse :for every directory given follow subdirectories encountered within
-s --symlinks :follow symlinks
-G --minsize=SIZE :consider only files greater than or equal to SIZE bytes
-L --maxsize=SIZE :consider only files less than or equal to SIZE bytes
-A --nohidden :exclude hidden files from consideration
-S --size :show size of duplicate files
Deleting the files
Use -d as an option with the command, Note: You should be extra cautious while using this command to delete file,
% fdupes -d -r /Downloads/myFiles
You will get an interactive screen for duplicate files asking which one to keep.

Have Questions? Post them here!
- How to Open Finder using Mac Terminal
- How to install maven in macOS using Terminal Command
- How to install iTerm2 Mac Terminal Alternative
- Find Mac version using terminal command
- Zsh Shell: Custom alias that you may find useful
- How to Uninstall Brew on Mac
- Go to Specific file path using Mac Finder
- How to open new tabs macOS Terminal
- fix macOS: The digital signature on the update is missing or invalid. Ventura
- ls: .: Operation not permitted - Mac Terminal ZSH Error
- Closest Alternate to Notepad on Mac
- How to Open Trash on Mac
- How to uninstall Microsoft Outlook on Mac
- [fix] macOS Ventura xcrun: error: invalid active developer path missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- [Vi/Vim] How to move cursor to the start of a line
- macOS 13 Ventura - The New About this Mac Window
- Best Free Gif screen capture app now available for M1 Chip Mac - LICECap
- 30+ Zoom video communications application shortcuts for macOS
- How to create alias in macOS
- How to install Node using Brew on Mac
- How to start/boot macOS in safe mode - Big Sur 11.0, Catalina 10.15, or Mojave 10.14
- Cant find System Preferences... under macOS Ventura Apple Menu?
- Mac turn dark mode on or off using terminal command
- How to Close Safari in Mac using Keyboard shortcut
- How to Upgrade Mac from Monterey to macOS Ventura
- Java JDBC Delete a Record in Database Table using PreparedStatement - Java
- [fix] openssl No such file or directory error C++ - Ubuntu
- How to generate ssh key? - HowTos
- Top 10 emerging breakthrough trending technologies - HowTos
- macOS say command text to speech using various voices and languages - MacOS
- Opening mac Terminal - MacOS
- Add Line Number before each line in Notepad++ using Column Editor - NotepadPlusPlus
- Eclipse Error The JVM Shared Library JavaVirtualMachines does not contain the JNI_CreateJavaVM symbol - Eclipse