LinuxCommandLibrary

jdupes

Find and delete duplicate files

TLDR

Search a single directory

$ jdupes [path/to/directory]
copy

Search multiple directories
$ jdupes [directory1 directory2 ...]
copy

Search all directories recursively
$ jdupes [[-r|--recurse]] [path/to/directory]
copy

Search directory recursively and let user choose files to preserve
$ jdupes [[-d|--delete]] [[-r|--recurse]] [path/to/directory]
copy

Search multiple directories and follow subdirectores under directory2, not directory1
$ jdupes [directory1] [[-R|--recurse:]] [directory2]
copy

Search multiple directories and keep the directory order in result
$ jdupes [[-O|--param-order]] [directory1 directory2 directory3 ...]
copy

SYNOPSIS

jdupes [options] dir1 [dir2 [dirN] ...]

PARAMETERS

-r, --recurse
    Recurse into subdirectories

-s, --symlinks
    Follow symbolic links

-H, --hardlinks
    Normally ignore hardlinks (use to include)

-d method, --delete[=method]
    Interactive prompt before deleting duplicates

-D method, --delete-all[=method]
    Automatically delete extra duplicates

-n, --noprompt
    Never prompt; imply -dd for deletion

-1, --preserve-first
    Preserve first file in each set (delete rest)

-o, --omit-first
    Omit first file from deletion prompts

-q, --quiet
    Suppress non-error messages

-v, --verbose
    Verbose output

-S bytes, --size=bytes
    Minimum file size to consider

-I pattern, --include=pattern
    Include files matching shell glob pattern

-X pattern, --exclude=pattern
    Exclude files matching shell glob pattern

-f file, --filelist=file
    Read list of files from specified file

-F, --filelists
    Read file lists from stdin

-m, --plus-minus
    Show size/hash matches that differ by content

-n, --no-color
    Disable color output

-A, --all
    Include hidden files (default in recent versions)

--help
    Show help

--version
    Show version info

DESCRIPTION

jdupes is an advanced command-line tool for identifying and managing duplicate files across directories on Unix-like systems. It is a high-performance rewrite of the classic fdupes, featuring dramatically faster scanning via multi-threading, optimized algorithms, and support for modern hash functions like xxHash, BLAKE3, and SHA-256.

jdupes scans files by size, partial hashes, and full content to detect exact duplicates, including hard links and symlinks. It excels in large-scale environments like servers or NAS, processing terabytes quickly while minimizing false positives. Key strengths include interactive deletion prompts, automated removal with safeguards (e.g., preserving the first or largest file), pattern-based inclusion/exclusion, and verbose reporting.

Users can recurse directories, filter by size or name, and output results in various formats. It's ideal for reclaiming disk space safely, with options to avoid hidden files or follow links. Unlike simpler tools, jdupes handles edge cases like sparse files and permissions robustly, making it a go-to for system administrators and power users.

CAVEATS

Use deletion options (-d/-D) cautiously as they can irreversibly remove files; test with -v first. Multi-threading may increase CPU usage. Symlink loops possible without care. Excludes empty files by default.

EXAMPLE USAGE

Basic scan: jdupes -r /home
Delete dupes: jdupes -r -d /path
Size filter: jdupes -r -S 1M /data

HASH METHODS

Default: xxHash (fastest). Specify via -dX (e.g., -dSHA256) for stronger verification.

HISTORY

Developed by Jody Bruchon starting 2015 as a faster, more feature-rich alternative to fdupes (2003). Achieves 10-100x speedups via xxHash and optimizations. Actively maintained with releases up to 2023+, focusing on accuracy and edge-case handling.

SEE ALSO

fdupes(1), rdfind(1), duff(1), fslint(1)

Copied to clipboard