Linux command
jdupes 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Find duplicate files
jdupes [path/to/directory]
Find duplicates recursively
jdupes -r [path/to/directory]
Delete duplicates interactively
jdupes -r -d [path/to/directory]
Delete duplicates automatically
jdupes -r -dN [path/to/directory]
Show duplicate sizes
jdupes -r -S [path/to/directory]
Use hard links
jdupes -r -L [path/to/directory]
Summarize duplicate statistics
jdupes -r -m [path/to/directory]
Compare across multiple directories
jdupes -r [dir1] [dir2] [dir3]
说明
jdupes is a fast duplicate file finder and remover. It identifies files with identical content by comparing file sizes, then partial hashes, then full hashes, and optionally byte-by-byte comparison for certainty. The tool is a fork and enhancement of the older fdupes program, offering better performance (often 7x faster) and additional features. It uses optimized comparison algorithms and can handle millions of files efficiently. Duplicates can be handled in several ways: interactive deletion (-d) presents choices for each set, automatic deletion (-dN) keeps the first file, and hard linking (-L) replaces duplicates with links to save space while preserving all filenames. When scanning multiple directories, jdupes compares files across all of them, useful for finding duplicates between a backup and primary storage. The summary mode (-m) gives a quick overview of potential space savings. The ordering option (-o) controls which file is considered "first" for automatic operations, allowing preference for keeping newer or alphabetically-first files.
参数
- -r, --recurse
- Recurse into subdirectories for all given directories.
- -R, --recurse:
- Recurse into subdirectories only for directories given after this flag.
- -d, --delete
- Prompt for which duplicates to delete.
- -N, --noprompt
- With -d, delete without prompting (keep first).
- -D, --debug
- Show debug/diagnostic output.
- -S, --size
- Show size of duplicate files.
- -m, --summarize
- Print summary of duplicate statistics.
- -L, --linkhard
- Replace duplicates with hard links.
- -s, --symlinks
- Follow symbolic links.
- -H, --hardlinks
- Treat hard links as duplicates.
- -n, --noempty
- Exclude zero-length files.
- -A, --nohidden
- Exclude hidden files.
- -f, --omitfirst
- Omit the first file in each duplicate set.
- -1, --sameline
- List each duplicate set on a single line.
- -0, --printnull
- Use null character as line terminator.
- -q, --quiet
- Hide progress indicator.
- -T, --partial-only
- Match based on partial hash only, ignoring the rest.
- -Q, --quick
- Skip byte-by-byte verification (use hashes only).
- -X, --xsize _+-=SIZE_
- Exclude files by size criteria.
- -o, --order _by_
- Order files by: name, time, none.
FAQ
What is the jdupes command used for?
jdupes is a fast duplicate file finder and remover. It identifies files with identical content by comparing file sizes, then partial hashes, then full hashes, and optionally byte-by-byte comparison for certainty. The tool is a fork and enhancement of the older fdupes program, offering better performance (often 7x faster) and additional features. It uses optimized comparison algorithms and can handle millions of files efficiently. Duplicates can be handled in several ways: interactive deletion (-d) presents choices for each set, automatic deletion (-dN) keeps the first file, and hard linking (-L) replaces duplicates with links to save space while preserving all filenames. When scanning multiple directories, jdupes compares files across all of them, useful for finding duplicates between a backup and primary storage. The summary mode (-m) gives a quick overview of potential space savings. The ordering option (-o) controls which file is considered "first" for automatic operations, allowing preference for keeping newer or alphabetically-first files.
How do I run a basic jdupes example?
Run `jdupes [path/to/directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r, --recurse do in jdupes?
Recurse into subdirectories for all given directories.