Storage drives accumulate redundant clutter over time, including duplicate downloads, cloned project directories, orphaned symlinks, and empty folder trees. While standard shell scripts can scan for identical file sizes, comparing gigabytes of data reliably requires cryptographic hashing and filesystem awareness. rmlint is an exceptionally fast, non-destructive duplicate finder for Linux that identifies duplicate files and generates executable shell scripts to inspect, hardlink, or delete them safely.
Why rmlint is the Safest Duplicate Finder for Linux
Many command-line deduplication tools automatically delete files on detection, creating a high risk of catastrophic data loss. rmlint employs a distinctly safer, two-stage operational model:
- Non-Destructive Scanning: rmlint never alters or deletes a single byte during its analysis pass. Instead, it generates a human-readable shell script (
rmlint.sh) containing the proposed cleanup commands. - Multi-Stage Paranoia Hashing: rmlint compares file sizes first, followed by fast partial checksums (MurmurHash), and finally full SHA-256 / SHA-1 cryptographic hashes only when preliminary metrics collide.
- Btrfs and ZFS Clone/Reflink Support: On modern copy-on-write filesystems, rmlint can reflink duplicate extents into shared metadata pointers without deleting file entries.
- Comprehensive Detection: Detects non-stripped duplicate binaries, broken symlinks, empty directories, and zero-byte files.
How to Install rmlint on Linux
rmlint is packaged across standard software repositories for all major distributions.
1. Ubuntu and Debian
sudo apt update && sudo apt install -y rmlint
2. Fedora and RHEL / CentOS
sudo dnf install -y rmlint
3. Arch Linux
sudo pacman -S rmlint
How to Scan for Duplicate Files with rmlint
To scan a directory tree (such as your user home folder or a backup drive):
- Navigate to or specify your target directory:
rmlint /path/to/target/folder - rmlint traverses the directory structure using multi-threaded I/O, outputting a real-time progress counter.
- Once complete, rmlint displays a detailed summary table showing:
- Number of duplicate files identified
- Total redundant disk space recoverable
- Number of empty directories located
- Notice that rmlint has generated two output files in your current working directory:
rmlint.sh: The executable review scriptrmlint.json: Machine-readable scan telemetry
Reviewing and Executing the Cleanup Script
Before running the generated script, inspect the proposed operations:
- Open the script in your pager or editor:
less rmlint.sh - Verify that the script preserves the original files while targeting only genuine duplicates for deletion.
- When satisfied, execute the script directly to reclaim your storage:
./rmlint.sh - If you prefer to convert duplicate files into hardlinks (saving space while keeping all file paths intact):
./rmlint.sh -c - On Btrfs or XFS filesystems, deduplicate extents using copy-on-write reflinks:
./rmlint.sh -r
Common Command-Line Flags and Scenarios
| Command Syntax | Operational Behavior |
|---|---|
rmlint -T "df" /data |
Restricts scanning exclusively to duplicate files (ignores empty folders and symlinks). |
rmlint -S 1M /data |
Ignores files smaller than 1 megabyte to accelerate scanning across massive archives. |
rmlint //original/dir /backup/dir |
Designates //original/dir as the golden master; rmlint will never delete files from that folder. |