#duplicate-file #duplicates #cleanup #cli #file-cleanup #hashing

bin+lib ddupe

Fast, cross-platform CLI for finding and removing duplicate files by content hash

2 stable releases

Uses new Rust 2024

1.1.0 Dec 8, 2025
1.0.0 Dec 2, 2025

#1297 in Filesystem

LGPL-3.0-or-later

31KB
592 lines

ddupe

CI Coverage Release License: LGPL v3 Rust Version Platform

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

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