dust — disk usage visualization
💬 "dust Command"
dust is a disk usage visualization tool that displays disk usage in a tree format, serving as a replacement for du.
It visualizes space usage per directory with bars. Unlike du, it sorts the results visually, showing the largest folders first.
- Concept: Visualizes space usage per directory with bars.
- Key Features: Unlike du, sorts the results visually, showing the largest folders first.
- Advantages: Instantly identify folders consuming the most space.
- Usage: Exclusion patterns can remove specific directories from the measurement.
Installation and Download
dust is installed via a package manager or the official script.
| Environment | Command |
|---|---|
| Ubuntu / Debian | sudo apt install du-dust |
| Fedora / RHEL | sudo dnf install dust |
| Arch | sudo pacman -S dust |
| macOS (brew) | brew install dust |
| Rust cargo | cargo install du-dust |
| Binary Download | github.com/bootandy/dust/releases |
Verify the installation with dust --version.
Frequently Used Options
| Option | Description |
|---|---|
| -d 2 | Limit tree depth to 2 levels |
| -n | Show number of files |
| -X pattern | Exclude directories matching the pattern |
| -r | Reverse the sort order |
| --perspective | Show percentage of total usage |
3 Essential Command Combinations
dust -d 2 /var— Check usage under /var up to 2 levels deepdust -X node_modules .— Measure excluding node_modulesdust -n /home— Check usage with file count
💬 "Show me an example of using dust on an actual server"
Here's a step-by-step guide for common scenarios encountered on production servers.
Step 1 · Verify Installation
Check if it is installed.
dust --version || sudo apt install -y du-dust
Step 2 · Check Root Entirely
Find the cause of a full disk.
dust -d 1 /
Step 3 · Specific Directory
Check details of the log directory.
dust -d 2 /var/log
Actual Execution Screen
Result of checking disk root usage with dust. It displays the largest folders first as bars.
!dust command execution result
Actual production server
How It's Used in Practice
1. Check Before Log Cleanup
Situation — Check if logs are consuming a lot of space.
dust -d 2 /var/log
Result — You can see that nginx/access.log accounts for most of it.
Point — Cleanup is only possible after identifying what's consuming the space.
2. Inspect Backup Directory
Situation — Quickly check the size of backup folders.
dust /backup
Result — Sizes of each backup folder are shown as bars.
Point — You can find and clean up old backups.
Actual Execution Screen
Result of checking the space distribution in the log directory.
!dust command execution result 2
Actual production server
Points to Note
- dust requires measurement time. Scanning the entire root can take several minutes.
- Using the -X option to exclude large directories like node_modules, .git makes the results more accurate.
- On Debian/Ubuntu, the package name is du-dust.
- Directories without permissions are excluded from measurement.
Source (HTML): https://games.aidebatehub.com/programs/linux/modern/dust.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments