crabclean CLI
crabclean CLI is a Rust‑powered command‑line tool that helps developers and everyday users quickly clean up unused, duplicate, and scattered files in any directory—automating smart grouping and safe deletion to keep your workspace lean and organized.
Features
- 🔍 Duplicate File Detection: Identifies exact duplicate files using SHA-256 content hashing
- ⏰ Unused File Cleanup: Finds files that haven't been accessed for a specified number of days
- 🎯 Interactive Deletion: Safe, user-confirmed deletion with progress tracking
- ⚡ High Performance: Multi-threaded scanning and hashing using Rayon
- 🛡️ Cross-Platform: Works on Linux, macOS, and Windows
- 📊 Progress Visualization: Real-time progress bars and spinners
- 🔄 Dry Run Mode: Preview operations without making changes
Installation
From crates.io (Recommended)
From Source
Pre-compiled Binaries
Download pre-compiled binaries from the Releases page.
Quick Start
Find Duplicate Files
# Dry run (preview only)
# Interactive deletion
# Current directory
Find Unused Files
# Find files unused for 30 days (default)
# Find files unused for 60 days
# Interactive deletion
Usage
crabclean your file system by finding and managing duplicate and unused files
Usage: crabclean <COMMAND> <SOURCE_DIRECTORY> <flag>
Commands:
duplicate Find and manage duplicate files
unused Find and manage unused files
help Print this message or the help of the given subcommand(s)
Flag:
--dry-run / -n To just know details
without args You will be prompted to ask for delete (Press ctrl + c to exit the terminal , only if you don't want to delete)
Options:
-h, --help Print help
-V, --version Print version
Duplicate Command
Find and manage duplicate files
Usage: crabclean duplicate [OPTIONS] [PATH]
Arguments:
[PATH] Path to the directory to scan [default: .]
Options:
-n, --dry-run Perform a dry run without deleting files
-h, --help Print help
Unused Command
Find and manage unused files
Usage: crabclean unused [OPTIONS] [PATH]
Arguments:
[PATH] Path to the directory to scan [default: .]
Options:
-a, --age <AGE> Age in days for a file to be considered unused [default: 30]
-n, --dry-run Perform a dry run without deleting files
-h, --help Print help
Examples
# Find duplicates in Downloads folder (dry run)
# Clean up unused files older than 90 days in project directory
# Interactive duplicate cleanup in current directory
Safety Features
- Dry run by default: Use
--dry-runto preview changes - Interactive confirmation: Each file deletion requires user confirmation
- Progress tracking: Visual feedback during long operations
- Error handling: Graceful error reporting and recovery
Performance
- Multi-threaded: Uses Rayon for parallel file processing
- Efficient hashing: SHA-256 with optimized buffer sizes
- Smart grouping: Files are first grouped by size before hashing
- Memory efficient: Streaming file processing for large files
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Changelog
See CHANGELOG.md for a list of changes in each version.