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.

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to MacOS,
- How to Display Analog Clock on Mac Menu Bar
- Shutdown Mac Terminal Command
- How to know the Serial Number of MacBook on macOS Ventura 13.0
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing
- [fix] How to Show file extensions on all files on Mac
- How to install Zoom Add-in to Outlook (Mac)
- How to turn off Stage Manager - macOS Ventura
- Fix - Xode - Internal logic error: Connection was invalidated
- How to do calculations in Mac Terminal
- How to delete a Page in Microsoft Word File on Mac (macOS)
- How to Refresh Mac Desktop
- How to install Java on macOS [Big Sur]
- How to Disable Mac Terminal Bell Sound
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to Uninstall Brew on Mac
- Find your macOS version
- Change TextEdit File Encoding
- AppleScript Example with TextEdit
- How to install homebrew (brew) on M1 Mac
- How to Find File and Directory Size in Mac Terminal
- How to open new tab in Sublime Text Editor [macOS]
- How to list all users in Mac Terminal
- Turn off Auto-Capitalization on macOS Ventura 13
- How to check Command Line Tools Version [Updated for Ventura]
- Change Current User Password using Mac Terminal Command
More Posts:
- [Event Log] Android Studio performance could be improved - Android-Studio
- [Android Studio] Error: Missing system image on device - Android-Studio
- Fix Power Automate FLOW error - InvalidTemplate Unable to process template language expressions in action - Microsoft
- Python: Convert Set to a List - Python
- Top 10 emerging breakthrough trending technologies - HowTos
- Is Facebook is down? Is it just for me? - Facebook
- Set width and height for the label in tkinter - Python
- Android Studio : Build Tools 23.0.0 rc1 is deprecated - Android-Studio