dust
Intuitive disk usage visualization like du but better.
Official WebsiteFeatures
Visual TreeColor OutputFastPercentage Display
Replaces
duInstallation
Homebrew
brew install dustPacman (Arch)
pacman -S dustCargo (Rust)
cargo install du-dustWhy use dust?
dust displays the output of the traditional du command in an intuitive tree format, making disk capacity assessment significantly easier. Written in Rust, it offers fast and beautiful output.
Visual Tree Display
Display directory structure in tree format. Instantly see which folders consume the most space.
Percentage Bars
Display usage of each directory with visual bars. Easy relative size comparison.
Fast Scanning
Parallel processing with Rust for fast disk scanning. Comfortable operation even with large directories.
Color Display
Color-coded display based on file size. Quickly identify large files and directories.
Basic Usage
Display Disk Usage
Basic Commands
# Display disk usage of current directory
dust
# Specify a specific directory
dust /path/to/directory
# Specify multiple directories
dust ~/Documents ~/DownloadsOutput Example
$ dust ~/projects/myapp
1.2G┌──node_modules
245M├──.next
89M│ ├──cache
156M│ └──static
45M├──src
12M└──public
1.5G───myapp
Visually compare directory sizes by the length of the bars.
Common Options
| Option | Description | Example |
|---|---|---|
-d, --depth | Limit display depth | dust -d 2 |
-n, --number-of-lines | Limit number of lines displayed | dust -n 10 |
-r, --reverse | Display in ascending size order | dust -r |
-s, --apparent-size | Display apparent size | dust -s |
-p, --full-paths | Display full paths | dust -p |
-f, --filecount | Display file count | dust -f |
-i, --ignore-directory | Exclude specific directories | dust -i node_modules |
-b, --no-percent-bars | Hide percentage bars | dust -b |
-c, --no-colors | Disable color display | dust -c |
Practical Examples
Limit Display Depth
Depth Limit
# Display only 2 levels
dust -d 2
# Display only top level
dust -d 1
# Home directory summary
dust -d 1 ~Exclude Specific Directories
Filtering
# Exclude node_modules
dust -i node_modules
# Exclude multiple directories
dust -i node_modules -i .git -i vendor
# Exclude hidden files
dust -i ".*"Sort by Size
Sorting
# Display in ascending order (default is descending)
dust -r
# Display top 10 only
dust -n 10
# Display bottom 10
dust -r -n 10Count Files
File Counting
# Display file count
dust -f
# Sort by file count
dust -f -r
# Check both size and file count
dust -f -d 2Script Integration
Script Integration
# Output without color (for piping)
dust -c -b
# Output in JSON format
dust -j
# Search for directories larger than specific size
dust -n 20 | grep -E "^[0-9]+G"Configuration and Customization
Shell Alias Configuration
~/.bashrc or ~/.zshrc
# Use dust instead of du
alias du='dust'
# Alias with depth limit
alias dus='dust -d 2'
# For summary display
alias dsum='dust -d 1'
# Version excluding node_modules
alias dustn='dust -i node_modules'
# Top 10 only
alias dust10='dust -n 10'Common Command Patterns
Practical Patterns
# Quickly check project disk usage
dust -d 2 -i node_modules -i .git
# Identify large files/directories
dust -n 15
# Analyze home directory capacity
dust -d 1 ~
# Check including hidden directories
dust -d 2 -aComparison with du
| Feature | du | dust |
|---|---|---|
| Tree Display | - | Default tree format |
| Percentage Bars | - | Visual bar display |
| Color Display | - | Color-coded by size |
| Sorting | sort command needed | Automatic size sorting |
| Processing Speed | Standard | Fast with parallel processing |
| Exclude Directories | --exclude | Easy with -i |
| File Count Display | Separate command needed | -f option |
| Readability | -h option needed | Always human-readable format |
Tips and Tricks
- •Use
dust -d 1to quickly check root-level capacity summary - •In project directories, using
-i node_modules -i .gitmakes it easier to understand actual code capacity - •With the
-soption, you can see the actual size of sparse files - •When scanning large directories, limit display lines with
-n 20for better readability - •For CI/CD or script usage, use
-c -bfor plain output - •For disk cleanup, use
dust -rto check smallest files first and efficiently identify unnecessary ones