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 find path of file on Mac Terminal
- How to disable Siri on Mac Monterey
- [fix] macOS Ventura xcrun: error: invalid active developer path missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- Select Line Number TextEdit on Mac
- Go to Specific file path using Mac Finder
- How to find Java HOME in Mac Terminal
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Must Know Homebrew Commands for Mac/Linux Users
- How to Insert an Inverted Question Mark on Mac ¿
- Hide Keyboard Text Input Icon on macOS Ventura Menu Bar
- How to make macOS Terminal window Transparent (or Opaque)
- How to check of Updates on Microsoft Edge Browser on Mac (macOS)
- Limit scrollback rows in macOS Terminal
- How to identify installed Java (JDK) Version on macOS
- Keyboard Shortcut to delete a file on a Mac [Macbook]
- Open Docker from Terminal Command on Mac
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to take a screenshot on a Mac - updated for Ventura 13 [updated 2023]
- ls: .: Operation not permitted - Mac Terminal ZSH Error
- How to remove username from Mac Menu Bar?
- macOS Ventura XCode Command Line Tools Installation
- Where is .zshrc file located in macOS
- How to Show Path of Files or App in Mac Spotlight Search
- How to enable root user on Mac Terminal
- Install Java 17 (LTS) JDK on ARM based M1/M2 Mac Natively
- Convert String Date to Date Object in Java - Java
- Change label (text) color in tkinter - Python
- SharePoint Server 2016 setup error - A system restart from a previous installation or update is pending. Restart your computer and run setup to continue. - SharePoint
- Enable Dark Mode in Gmail Desktop Browser - Google
- pip get list of all outdated Python packages - Python
- List of Eclipse versions and future releases (2022-06) - Eclipse
- Android Studio Ctrl Shift o auto import not working - Android
- Access Windows share folder in Ubuntu Device in Network - Ubuntu