A high-performance disk usage analysis tool built in Rust, designed to replace legacy shell scripts with a fast, parallel, cross-platform solution.
- Fast Analysis: 3-4x faster than shell-based tools through parallel processing
- Visual Output: Color-coded bar chart display for easy identification of space usage
- Flexible Filtering: Exclude patterns with glob syntax support
- Depth Control: Limit directory traversal depth for focused analysis
- Multiple Output Formats: Human-readable table or JSON for automation
- Cross-Platform: Works on Linux, macOS, Windows, and FreeBSD
DuTop runs on all major platforms:
- ✅ macOS (Intel & Apple Silicon)
- ✅ Linux (x86_64, ARM64, musl)
- ✅ Windows (x86_64)
- ✅ FreeBSD and other Unix-like systems
Download pre-built binary:
# macOS (Universal - Intel + Apple Silicon)
curl -L https://github.com/UnTypeBeats/DuTop/releases/latest/download/dutop-0.1.0-universal-apple-darwin.tar.gz | tar xz
# IMPORTANT: Remove quarantine attribute on macOS
xattr -d com.apple.quarantine dutop-universal
sudo mv dutop-universal /usr/local/bin/dutop
# Linux x86_64
curl -L https://github.com/UnTypeBeats/DuTop/releases/latest/download/dutop-0.1.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
sudo mv dutop /usr/local/bin/
# Linux (static musl - works everywhere)
curl -L https://github.com/UnTypeBeats/DuTop/releases/latest/download/dutop-0.1.0-x86_64-unknown-linux-musl.tar.gz | tar xz
sudo mv dutop /usr/local/bin/
⚠️ macOS Users: Downloaded binaries will be blocked by Gatekeeper. You MUST runxattr -d com.apple.quarantine dutop-universalbefore installation.
Using Cargo (from source):
cargo install dutop
# or from git
cargo install --git https://github.com/yourusername/dutopUsing Homebrew (macOS/Linux):
brew tap yourusername/dutop
brew install dutopDownload pre-built binary:
- Download
dutop-VERSION-x86_64-pc-windows-msvc.zipfrom releases - Extract
dutop.exe - Add to PATH or move to
C:\Windows\System32\
Using Cargo:
cargo install dutopUsing Scoop:
scoop bucket add dutop https://github.com/yourusername/scoop-dutop
scoop install dutopgit clone https://github.com/UnTypeBeats/dutop
cd dutop
cargo build --release
# macOS: Remove quarantine attribute (bypasses Gatekeeper)
xattr -d com.apple.quarantine target/release/dutop
# Install (Unix)
sudo cp target/release/dutop /usr/local/bin/
# Install (Windows - as Administrator)
copy target\release\dutop.exe C:\Windows\System32\Binary size: ~1.6MB (optimized and stripped)
If you get a "cannot be opened because the developer cannot be verified" error:
Option 1: Remove quarantine attribute
xattr -d com.apple.quarantine /path/to/dutopOption 2: System Settings
- Right-click the binary → "Open"
- Click "Open" in the security dialog
- macOS will remember this exception
Option 3: Command line bypass
sudo spctl --master-disable # Disable Gatekeeper (not recommended)
# Run dutop
sudo spctl --master-enable # Re-enable GatekeeperFor distributed binaries, proper code signing and notarization are needed (requires Apple Developer account).
# Analyze current directory, show top 10
dutop
# Analyze specific directory
dutop /path/to/directory
# Show top 20 directories
dutop -n 20
# Exclude patterns (can be specified multiple times)
dutop --exclude "node_modules" --exclude "target" --exclude "*.log"# Limit traversal depth
dutop -d 2 /path/to/directory
# Output as JSON for scripting
dutop --format json . > usage.json
# Use specific number of threads
dutop -j 4 .
# Follow symbolic links
dutop -L /path/with/symlinks
# Disable colors
dutop --no-color
# Enable verbose logging
dutop -vExample 1: Quick workspace cleanup
dutop -n 15 ~/projects --exclude ".git"Example 2: Find large directories for archival
dutop -n 5 /data --format json | jq '.top_directories[] | select(.size > 1000000000)'Example 3: Shallow scan of home directory
dutop -d 1 ~Analyzing: /Users/username/projects
┌────────────────────────────────┬──────────┬───────┬──────────────────────────────┐
│ ██████████████████████████████ │ 454.6 M │ 100% │ target │
│ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 26.7 K │ 0% │ node_modules │
│ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 22.9 K │ 0% │ src │
└────────────────────────────────┴──────────┴───────┴──────────────────────────────┘
Total: 454.7 M
Files: 2261 Directories: 347
The bar chart uses color coding:
- 🟢 Green: < 33% of maximum
- 🟡 Yellow: 33-50% of maximum
- 🔴 Red: > 50% of maximum
{
"path": "/Users/username/projects",
"total_size": 476839936,
"total_size_human": "454.7 M",
"file_count": 2261,
"directory_count": 347,
"top_directories": [
{
"path": "/Users/username/projects/target",
"size": 476647424,
"size_human": "454.6 M",
"percentage": 99.95965735523452,
"file_count": 2237,
"dir_count": 340
}
]
}Performance comparison on a directory with ~2,000 files:
| Tool | Time |
|---|---|
wdu.sh (shell script) |
907ms |
dutop (Rust) |
250ms |
Result: 3.6x faster with the Rust implementation
For larger directories (100K+ files), the performance gain is even more significant due to parallel processing.
0: Success1: General error2: Invalid arguments3: Permission denied4: Path not found5: Disk I/O error
Usage: dutop [OPTIONS] [PATH]
Arguments:
[PATH] Directory to analyze (default: current directory)
Options:
-n, --top <TOP> Number of top directories to display [default: 10]
-d, --depth <DEPTH> Maximum depth to traverse (default: unlimited)
-x, --exclude <EXCLUDE> Exclude patterns (glob syntax, can be specified multiple times)
-L, --follow-links Follow symbolic links
-j, --threads <THREADS> Number of threads to use (default: auto-detect)
-f, --format <FORMAT> Output format: human (default), json [possible values: human, json]
--no-color Disable colored output
-v, --verbose Enable verbose logging
--debug Enable debug logging
-h, --help Print help
-V, --version Print version
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_exclusion_patternscargo benchCurrent Version: 0.1.0 (MVP)
This is the MVP release with core functionality. See PRD.md for the full roadmap.
- ✅ Directory size analysis with parallel processing
- ✅ Top N directories display
- ✅ Human-readable size formatting
- ✅ Depth control
- ✅ Exclusion patterns (glob syntax)
- ✅ JSON output format
- ✅ Color-coded bar chart visualization
- ✅ Proper error handling and exit codes
- ✅ Multi-threaded analysis with configurable thread count
- CSV/YAML output formats
- Progress indication for large scans
- Size threshold filtering
- Configuration file support
- Interactive TUI mode
- Watch mode for continuous monitoring
MIT
Contributions welcome! Please see PRD.md for project requirements and architecture details.