fdupes
Identify and optionally delete duplicate files
TLDR
Search a single directory
Search multiple directories
Search a directory recursively
Search multiple directories, one recursively
Search recursively, considering hardlinks as duplicates
Search recursively for duplicates and display interactive prompt to pick which ones to keep, deleting the others
Search recursively and delete duplicates without prompting
SYNOPSIS
fdupes [options] dir1 [dir2 ...]
PARAMETERS
-r, --recursive
Recurse into subdirectories
-s, --size
Show only first file per size group; skip further duplicate checks
-H, --hardlinks
Treat identical hardlinks as separate files
-l, --listfiles
List files without prompting for deletion
-S BYTES, --minsize=BYTES
Skip files smaller than specified bytes
-X CMD, --exec=CMD
Execute CMD on each duplicate set ({} for filename)
-o FILE, --output=FILE
Write output to FILE instead of stdout
-i, --immediate
Delete duplicates without prompting
-d, --delete
Interactively prompt before deleting duplicates
-v, --verbose
Enable verbose progress output
-q, --quiet
Suppress non-error output
--debug
Enable debug logging
-1, --oneline
Display duplicates on single lines
-A, --appledouble
Skip .AppleDouble files
-f, --stdin
Read file list from stdin
-I PATTERN, --include=PATTERN
Include files matching regex PATTERN
--exclude=PATTERN
Exclude files matching regex PATTERN
-h, --help
Display help and exit
-V, --version
Show version information
DESCRIPTION
fdupes is a powerful command-line tool for identifying duplicate files across one or more directories. It efficiently detects duplicates by first comparing file sizes, then computing MD5 signatures for potential matches, and finally performing byte-by-byte comparisons to confirm identical content. This multi-stage approach ensures high accuracy while minimizing unnecessary computations.
Ideal for freeing disk space, managing large media libraries, or cleaning backups, fdupes supports recursive scanning, hard link handling, and interactive deletion prompts. Users can list duplicates, delete them selectively, or execute custom commands on matches. It's lightweight, fast on modern hardware, and handles millions of files effectively.
Output groups duplicates together, showing paths for easy review. Options allow customization like excluding patterns, skipping small files, or quiet mode for scripting. While safe by default (read-only), delete features require caution to avoid data loss.
CAVEATS
Delete options (-d, -i) can cause permanent data loss; always backup first. Recursive scans on large filesystems may consume significant time/memory. Not suitable for concurrent use on active directories. Run as non-root to avoid permission issues.
HOW IT WORKS
Stage 1: Size filter.
Stage 2: MD5 hash.
Stage 3: Byte comparison for confirmed duplicates.
EXAMPLE
fdupes -r /home lists duplicates recursively.
fdupes -rd /photos prompts to delete in /photos.
HISTORY
Developed by Jody Bruchon starting in 2007 as an efficient alternative to slower duplicate finders. Actively maintained with performance optimizations; version 2.0+ introduced multithreading. Popular in Linux distros since ~2010; jdupes is a modern fork with enhancements.


