Linux command
rmlint 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Find duplicates in directory
rmlint [/path/to/directory]
Find duplicates and generate removal script
rmlint [/path/to/directory]
Find only duplicate files
rmlint -T df [/path/to/directory]
Keep first found duplicate
rmlint -k [/path/to/directory]
Compare two directories
rmlint [/path/to/originals] // [/path/to/duplicates]
Find empty files and directories
rmlint -T ef,ed [/path/to/directory]
Dry run
rmlint --dry-run [/path/to/directory]
JSON output
rmlint -o json [/path/to/directory]
说明
rmlint finds duplicate files, empty files, broken symlinks, and other lint. It generates scripts to remove or manage found items. Duplicate detection uses progressive matching: size first, then partial hashes, finally full hashes or paranoid byte comparison. This minimizes I/O for large collections. The double-slash (//) separator defines original vs duplicate paths. Files in paths before // are preferred originals; those after are marked as duplicates. This enables controlled cleanup of backup or mirror directories. Output includes a shell script (rmlint.sh) with removal commands. The script is cautious by default, requiring confirmation and keeping originals. JSON and CSV outputs enable custom processing. Sorting criteria (-S) determine which duplicate is kept: by age, path depth, basename length, or alphabetically. Multiple criteria combine for fine-grained control. Additional lint types include: empty directories, broken symlinks, files with bad user/group, and non-stripped binaries.
参数
- -T, --types _TYPES_
- Find types: df (duplicates), ef (empty files), ed (empty dirs).
- -k, --keep-all-tagged
- Keep files in tagged (first) paths.
- -m, --must-match-tagged
- Require match in tagged path.
- -o, --output _FMT_
- Output format: sh, csv, json, py.
- -c, --config _FMT:KEY=VALUE_
- Configure output handler.
- -s, --size _RANGE_
- Filter by file size.
- -d, --max-depth _N_
- Maximum directory depth.
- --dry-run
- Don't write output files.
- -g, --progress
- Show progress bar.
- -p, --paranoid
- Byte-by-byte comparison.
- -S _CRITERIA_, --sortcriteria _CRITERIA_
- Sorting for original selection.
- -n, --newer-than-stamp _FILE_
- Only files newer than file.
- -r, --hidden
- Include hidden files.
- -f, --followlinks
- Follow symbolic links.
FAQ
What is the rmlint command used for?
rmlint finds duplicate files, empty files, broken symlinks, and other lint. It generates scripts to remove or manage found items. Duplicate detection uses progressive matching: size first, then partial hashes, finally full hashes or paranoid byte comparison. This minimizes I/O for large collections. The double-slash (//) separator defines original vs duplicate paths. Files in paths before // are preferred originals; those after are marked as duplicates. This enables controlled cleanup of backup or mirror directories. Output includes a shell script (rmlint.sh) with removal commands. The script is cautious by default, requiring confirmation and keeping originals. JSON and CSV outputs enable custom processing. Sorting criteria (-S) determine which duplicate is kept: by age, path depth, basename length, or alphabetically. Multiple criteria combine for fine-grained control. Additional lint types include: empty directories, broken symlinks, files with bad user/group, and non-stripped binaries.
How do I run a basic rmlint example?
Run `rmlint [/path/to/directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -T, --types _TYPES_ do in rmlint?
Find types: df (duplicates), ef (empty files), ed (empty dirs).