| Crates.io | rudu |
| lib.rs | rudu |
| version | 0.2.7 |
| created_at | 2025-07-13 19:12:36.603485+00 |
| updated_at | 2025-07-14 03:49:26.234189+00 |
| description | Fast, parallel Rust CLI tool for analyzing directory sizes |
| homepage | https://github.com/ayungavis/rudu |
| repository | https://github.com/ayungavis/rudu |
| max_upload_size | |
| id | 1750706 |
| size | 93,372 |
A fast, parallel Rust CLI tool for analyzing directory sizes and finding the largest directories under a given path. Think of it as a modern, performant alternative to du with a focus on identifying space-consuming directories quickly.
/)One-liner installation for Linux and macOS:
curl -sSL https://raw.githubusercontent.com/ayungavis/rudu/main/install.sh | bash
Or download and run the installer:
wget https://raw.githubusercontent.com/ayungavis/rudu/main/install.sh
chmod +x install.sh
./install.sh
Custom installation directory:
INSTALL_DIR=~/.local/bin curl -sSL https://raw.githubusercontent.com/ayungavis/rudu/main/install.sh | bash
# Add the tap (once the formula is published)
brew tap ayungavis/tap
brew install rudu
cargo install rudu
Debian/Ubuntu (.deb):
# Download the .deb package from releases
wget https://github.com/ayungavis/rudu/releases/download/v0.2.7/rudu_0.1.0_amd64.deb
sudo dpkg -i rudu_0.1.0_amd64.deb
Red Hat/Fedora/CentOS (.rpm):
# Use the provided RPM spec file to build
rpmbuild -ba dist/rpm/rudu.spec
Arch Linux (AUR):
# Use the provided PKGBUILD
makepkg -si
AppImage (Universal Linux):
# Download and run
wget https://github.com/ayungavis/rudu/releases/download/v0.2.7/rudu-0.1.0-x86_64.AppImage
chmod +x rudu-0.1.0-x86_64.AppImage
./rudu-0.1.0-x86_64.AppImage
Download the latest release for your platform from the releases page:
rudu-linux-x86_64.tar.gzrudu-linux-x86_64-musl.tar.gzrudu-macos-x86_64.tar.gzrudu-macos-aarch64.tar.gzExtract and install:
# Example for Linux
tar -xzf rudu-linux-x86_64.tar.gz
sudo mv rudu /usr/local/bin/
git clone https://github.com/ayungavis/rudu.git
cd rudu
make install # Install to /usr/local/bin (requires sudo)
# or
make install-user # Install to ~/.local/bin
git clone https://github.com/ayungavis/rudu.git
cd rudu
cargo build --release
The binary will be available at target/release/rudu.
After installation, verify it works:
rudu --version
rudu --help
# Analyze current directory, show top 10 largest subdirectories
rudu .
# Analyze root directory (default)
rudu
# Analyze specific directory
rudu /home/user/Documents
# Show top 20 largest directories
rudu -n 20 /var/log
# Show top 5 largest directories with long flag
rudu --number 5 /usr/local
# Suppress informational messages for scripting
rudu --quiet /home/user
# Short form of quiet mode
rudu -q /var/log
# Enable caching for faster subsequent scans
rudu --cache /home/user
# Use cache with custom max age (in hours)
rudu --cache --cache-age 12 /var/log
# Show cache statistics
rudu --cache-stats
# Clear all cached data
rudu --clear-cache
🔍 Scanning directory: /home/user/Documents
💾 Cached results for /home/user/Documents
🔥 1. 1.2 GB Videos
📦 2. 456.7 MB Photos
📁 3. 123.4 MB Projects/rust-project
📁 4. 89.2 MB Downloads
📄 5. 45.6 MB Books
📊 Summary of /home/user/Documents
💾 Total file size: 2.4 GB
📋 Total files: 2847
⏱️ Time taken: 125.43ms
Note: The actual output includes beautiful colors and emojis that enhance the visual experience!
path - Root directory to analyze (default: /)-n, --number <NUMBER> - Number of top results to show (default: 10)-q, --quiet - Suppress informational messages for scripting-c, --cache - Enable caching for faster subsequent scans--cache-age <HOURS> - Maximum cache age in hours (default: 24)--cache-stats - Show cache statistics--clear-cache - Clear all cached data-h, --help - Show help information-V, --version - Show version informationwalkdir to recursively walk through all files in the directory treeThe tool now includes hardlink detection to provide more accurate file size calculations:
This is particularly important on macOS and Linux systems where system files often use hardlinks.
Rudu includes a smart caching system that dramatically speeds up subsequent scans:
--cache, scan results are automatically stored in your system's cache directory/home/user/Documents after caching /home/user is nearly instant# Enable caching for a scan
rudu --cache /large/directory
# Set custom cache expiry (12 hours)
rudu --cache --cache-age 12 /path/to/scan
# View cache statistics
rudu --cache-stats
# Clear all cached data
rudu --clear-cache
~/.cache/rudu/~/Library/Caches/rudu/%LOCALAPPDATA%\rudu\cache\Rudu provides different performance characteristics compared to the standard du command:
du due to additional features (hardlink detection, progress tracking, cache preparation)du for subsequent runsFor detailed benchmark results comparing rudu with du, see docs/BENCHMARK.md.
For technical details about performance optimizations, see docs/OPTIMIZATIONS.md.
# Clone the repository
git clone https://github.com/ayungavis/rudu.git
cd rudu
# Build in debug mode
cargo build
# Build in release mode (optimized)
cargo build --release
# Run directly with cargo
cargo run -- /path/to/analyze
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_nested_dirs
src/main.rs - CLI interface and main application logicsrc/lib.rs - Core directory size computation algorithmsrc/cache.rs - Caching system implementationCargo.toml - Project configuration and dependenciesclap - Command-line argument parsing with derive macros
walkdir - Recursive directory traversal
humansize - Human-readable file size formatting
rayon - Data parallelism for sorting
tempfile - Temporary file handling for tests
colored - Terminal color and styling support
serde - Serialization framework for cache data
serde_json - JSON serialization for cache storage
dirs - Cross-platform system directory detection
We welcome contributions! Here's how you can help:
git clone https://github.com/ayungavis/rudu.gitgit checkout -b feature/your-feature-namecargo testcargo clippycargo fmtgit commit -m "Add your feature"git push origin feature/your-feature-namecargo fmt)cargo clippy)# Add criterion to dev-dependencies if implementing benchmarks
cargo bench
# Run with debug logging
RUST_LOG=debug cargo run -- /path/to/analyze
# Run with backtraces on panic
RUST_BACKTRACE=1 cargo run -- /path/to/analyze
This project uses GitHub Actions for continuous integration and deployment:
CI Pipeline (.github/workflows/ci.yml):
cargo fmt)cargo clippy)Security Audit (.github/workflows/security-audit.yml):
cargo auditcargo denyRelease Pipeline (.github/workflows/release.yml):
To enable all CI/CD features, you'll need to:
CRATES_TOKEN secret to your GitHub repository settings
CRATES_TOKEN# Run the same checks as CI
cargo test --all-features --workspace # Tests
cargo fmt --all -- --check # Formatting
cargo clippy --all-targets --all-features -- -D warnings # Linting
cargo audit # Security audit
cargo deny check # License/dependency check
This project is licensed under the MIT License - see the LICENSE file for details.
du commandFound a bug or have a feature request? Please open an issue on GitHub.