Terminal GuideTerminal Guide
dust icon

dust

Modern CLI
macOSLinuxWindows
Rust

Intuitive disk usage visualization like du but better.

Official Website

Features

Visual TreeColor OutputFastPercentage Display
Replaces
du

Installation

Homebrew
brew install dust
Pacman (Arch)
pacman -S dust
Cargo (Rust)
cargo install du-dust

Why 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 ~/Downloads

Output 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

OptionDescriptionExample
-d, --depthLimit display depthdust -d 2
-n, --number-of-linesLimit number of lines displayeddust -n 10
-r, --reverseDisplay in ascending size orderdust -r
-s, --apparent-sizeDisplay apparent sizedust -s
-p, --full-pathsDisplay full pathsdust -p
-f, --filecountDisplay file countdust -f
-i, --ignore-directoryExclude specific directoriesdust -i node_modules
-b, --no-percent-barsHide percentage barsdust -b
-c, --no-colorsDisable color displaydust -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 10

Count Files

File Counting
# Display file count
dust -f

# Sort by file count
dust -f -r

# Check both size and file count
dust -f -d 2

Script 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 -a

Comparison with du

Featuredudust
Tree Display-Default tree format
Percentage Bars-Visual bar display
Color Display-Color-coded by size
Sortingsort command neededAutomatic size sorting
Processing SpeedStandardFast with parallel processing
Exclude Directories--excludeEasy with -i
File Count DisplaySeparate command needed-f option
Readability-h option neededAlways human-readable format

Tips and Tricks

  • Use dust -d 1 to quickly check root-level capacity summary
  • In project directories, using -i node_modules -i .git makes it easier to understand actual code capacity
  • With the -s option, you can see the actual size of sparse files
  • When scanning large directories, limit display lines with -n 20 for better readability
  • For CI/CD or script usage, use -c -b for plain output
  • For disk cleanup, use dust -r to check smallest files first and efficiently identify unnecessary ones
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More