2 stable releases
Uses new Rust 2024
| 1.1.0 | Dec 8, 2025 |
|---|---|
| 1.0.0 | Dec 2, 2025 |
#1297 in Filesystem
31KB
592 lines
ddupe
ddupe is a fast, safe, cross-platform command-line tool for finding and removing duplicate files.
Duplicates are detected by hashing file contents using SHA-256, so files are matched by content, not name or location.
Useful for cleaning up:
- Photo collections
- Download folders
- Backups / archives
- Source trees
- Any directory full of near-identical files
ddupe works recursively and will scan an entire directory tree.
๐ Summary
| Item | Details |
|---|---|
| Name | ddupe |
| Description | Fast, safe, cross-platform duplicate-file detector & cleaner |
| Languages | Rust (CLI, async-ready, cross-platform) |
| Supported OS | Linux ยท macOS ยท Windows |
| Duplicate Method | SHA-256 content hashing (filename/location independent) |
| Key Features | Recursive scan ยท Colourised output ยท Progress bar ยท Dry-run mode |
| Safety | Interactive confirmation step before deletion |
| Binary Releases | Available for Linux/macOS/Windows (built via GitHub Actions) |
| License | LGPL-3.0-or-later |
| CI | rustfmt ยท clippy (warnings = errors) ยท unit + integration tests |
๐ Capabilities at a Glance
- ๐ Deep recursive scanning of entire directory trees
- ๐ง Content-based detection using SHA-256 hashes
- ๐จ Readable output with colours and group markers
- ๐ Progress bars for large scans
- ๐งช Dry-run mode for safe previews
- ๐๏ธ Optional deletion with clear KEEP/DUPE status
- ๐พ Total space estimate before removing anything
- ๐งฐ Pure Rust library + thin CLI wrapper
- ๐ Cross-platform binaries via GitHub Actions
โ Why ddupe?
Most duplicate cleaners rely on filenames, heuristics, or metadata.
ddupe instead:
- hashes the actual file content
- groups truly identical files regardless of name or location
- avoids false matches or โsmart guessingโ
- works the same on Linux, macOS, and Windows
- is scriptable, testable, and written with safe Rust practices
โจ Features
- ๐ Fast recursive scanning
- ๐ง Content-based deduplication (SHA-256)
- ๐จ Colourised output for clarity
- ๐ Progress bar while hashing
- ๐งฎ Reports how much disk space can be freed
- ๐ Interactive mode (
-i) to accept/reject each duplicate (or keep all) - ๐ Safe by default โ always asks before deleting
- ๐งช Dry-run mode (
--dry-run) to preview deletions - ๐งพ JSON report output (
--json-output <file>) that never deletes or prompts - ๐ฅ Optional Windows/Linux/macOS binaries (cross-compiled)
๐ฆ Installation
๐ง Build from source (recommended)
git clone https://github.com/yourname/ddupe.git
cd ddupe
cargo build --release
# binary will be at target/release/ddupe
๐งพ JSON report (no deletions)
Export a structured report without deleting or prompting:
ddupe --json-output /path/to/report.json /path/to/scan
This behaves like a dry run: it never deletes files, produces no terminal output, and writes the analysis to the specified JSON file. In the JSON report, all files in a duplicate group are listed (no preselected โkeepโ). It skips the KEEP/DUPE listing but still shows the header and progress.
๐ ๏ธ Development
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test
Dependencies
~5โ17MB
~172K SLoC