⚡ Fast disk usage analyzer that groups files by extension. Perfect for finding what's taking up space on your drives.
A parallel, high-performance CLI tool that scans directories and displays disk usage statistics grouped by file extension, with beautiful terminal output.
✅ Parallel scanning - Uses all CPU cores for maximum speed ✅ Beautiful table output - Color-coded results with visual bars ✅ Flexible filtering - Minimum file size, top N extensions ✅ File count tracking - See how many files per extension ✅ No dependencies - Single binary, works everywhere
# Clone or copy the project
cd extstat
# Build release version (optimized)
cargo build --release
# Binary will be in target/release/extstat
# Copy to your PATH
sudo cp target/release/extstat /usr/local/bin/# Analyze current directory
extstat
# Analyze specific directory
extstat /path/to/directory
# Show file counts
extstat -c
# Filter small files (e.g., min 1MB)
extstat -s 1048576
# Show only top 20 extensions
extstat -n 20
# Combine options
extstat /data -c -s 1000000 -n 10# Analyze your home directory
extstat ~
# Find what's taking space in /var
extstat /var -n 15
# Show detailed stats for current project
extstat . -cOptions:
<PATH> Directory to analyze [default: .]
-s, --min-size Minimum file size to include (in bytes) [default: 0]
-n, --top Maximum number of extensions to display [default: 50]
-c, --show-count Show file count
-h, --help Print help
-V, --version Print version
╭────────────┬──────────┬─────────┬──────────────────────────────────╮
│ Extension │ Size │ % Total │ Visual │
├────────────┼──────────┼─────────┼──────────────────────────────────┤
│ .fastq │ 2.5 GiB │ 45.23% │ ██████████████░░░░░░░░░░░░░░░░░░ │
│ .bam │ 1.2 GiB │ 21.67% │ ███████░░░░░░░░░░░░░░░░░░░░░░░░░ │
│ .fasta │ 567 MiB │ 10.11% │ ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
╰────────────┴──────────┴─────────┴──────────────────────────────────╯
- Extension: File extension (or [no extension] for files without one)
- Size: Total size for all files with this extension (human-readable)
- % Total: Percentage of total scanned space
- Visual: Bar chart representation
- Parallel scanning using Rayon (uses all CPU cores)
- Typical performance: ~500k files/second on modern SSD
- Memory efficient: doesn't load file contents, only metadata
extstat/
├── Cargo.toml # Rust dependencies
├── src/
│ └── main.rs # Main application code
└── README.md # This file
# Build debug version (faster compilation)
cargo build
# Run directly
cargo run -- /path/to/scan
# Run with options
cargo run -- . -c -n 10Key Rust concepts used:
-
Parallel iteration with Rayon:
files.par_iter() // Process files in parallel
-
Result handling with
?:let metadata = entry.metadata().ok()?; // Return None if error
-
Pattern matching:
path.extension() .and_then(|s| s.to_str()) // Chain operations safely
-
HashMap aggregation:
let entry = acc.entry(ext).or_insert((0, 0)); // Get or create entry.0 += size; // Update tuple
Want to add more features? Common additions:
- JSON export: Add
serdeandserde_jsondependencies - Interactive TUI: Add
ratatuiandcrossterm - Progress bar: Add
indicatifdependency - Date filtering: Use file metadata
modified()time
Permission denied errors:
- Use
sudofor system directories - Or skip inaccessible files (feature coming soon)
Slow on network drives:
- Network I/O is the bottleneck, not the tool
- Consider scanning locally first
Out of memory:
- Only happens with millions of different extensions
- Try filtering with
-sto reduce file count
- Speed: As fast as C/C++, often faster than Go/Python
- Safety: No segfaults, data races prevented at compile time
- Modern: Great tooling (cargo), helpful compiler errors
- Dependencies: Easy to manage, reproducible builds
Planned features:
- Interactive TUI mode (like ncdu)
- Drill-down: click extension → see directories
- Export to JSON/CSV
- Progress bar during scan
- Filter by date modified
- Compare two scans (before/after cleanup)
Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
See CHANGELOG.md for a list of changes in each release.
MIT License - Feel free to use, modify, distribute