When an alert triggers saying a server's root partition is 95% full, running standard du -sh * | sort -h is painfully slow and produces an unformatted wall of numbers. You have to repeatedly run commands, change directories, and recalculate sizes manually. dust (written in Rust by Andy Boot) gives you an immediate graphical tree breakdown with color-coded bar charts, letting you spot the culprit in a single glance.
Key Features
- Visual Proportional Bars: Renders inline ASCII bar graphs illustrating exactly what percentage of a parent folder each subdirectory consumes.
- Smart Inverted Layout: Places the largest directories at the very bottom of the terminal output, ensuring you never have to scroll backwards to see what's consuming disk space.
- Depth Limiting (
-d): Restrict the recursion depth (e.g.dust -d 2) to get a clean high-level overview without drowning in individual file details.
dust Parallel Scanning & Tree Aggregation
Useful `dust` Command Flags
| Flag | Purpose | Example Command |
|---|---|---|
| -d <depth> | Limit directory tree depth | dust -d 2 |
| -n <count> | Show top N largest items only | dust -n 10 |
| -X <pattern> | Exclude specific paths | dust -X .git |
When diagnosing disk space issues on servers across system directories like /var/lib/docker or /var/log, running dust as a standard user will result in Permission denied warnings, causing directories to be omitted from calculation and giving misleadingly small totals. Always run with sudo dust / when investigating root disk usage.
Learn more and download binaries on the official dust GitHub repository.
Discussion & Issues
Comments
Post a Comment