dust: 7 Essential Dust Command Features for Linux Disk Usage

What Is the dust Command?

The dust command is a modern replacement for the classic Linux du tool. Written in Rust, the dust command gives you a clean, visual overview of disk usage right in your terminal. No piping to sort -h. No counting lines. Just one command and you see exactly what is eating your disk space.

I switched to dust about a year ago and honestly, I haven’t looked back. The standard du workflow gets the job done, but dust makes it actually pleasant. The name comes from “du + Rust”, and it lives at github.com/bootandy/dust where it has over 11,000 stars.

This guide walks through 7 essential features of the dust command, from basic usage to advanced tricks. By the end, you will know exactly how to track down disk hogs on any Linux system.

Installing the dust Command

Getting the dust command on your system is straightforward. The easiest method is through your package manager:

# Ubuntu/Debian (via cargo)
sudo apt install cargo
cargo install du-dust

# Fedora (official repos as du-dust)
sudo dnf install du-dust

# macOS
brew install dust

# Arch Linux
sudo pacman -S du-dust

# Snap (limited to /home)
snap install dust

After installing, the binary is called dust, not du-dust. Run dust --version to verify it works. If you used cargo, make sure ~/.cargo/bin is in your PATH.

I prefer the cargo method because you always get the latest release. The current version is 1.2.4 as of early 2026.

Basic dust Command Usage

The simplest way to use the dust command is to run it with no arguments:

dust

This scans your current directory and shows the biggest subdirectories first. The output uses ASCII bars and colors to show how much space each item takes. Darker bars are top-level directories. Lighter shades are deeper subdirectories.

You can also target a specific directory:

dust /var/log
dust /home ~/projects

Passing multiple paths combines them into a single view. This is handy when you want to compare disk usage across several locations at once.

Here is the key difference from du — dust automatically limits output to fit your terminal height. No more scrolling through hundreds of lines. If your terminal is 24 rows tall, you get the 24 biggest offenders. That is it.

If that sounds familiar, check out our guide on fd command examples for another Rust-based alternative that simplifies a classic Linux tool.

Essential dust Command Flags

The dust command has a solid set of flags. Here are the ones I use daily:

Controlling Output Volume with -n and -d

# Show exactly 30 entries
dust -n 30

# Limit depth to 3 levels
dust -d 3

# Show 30 entries at 2 levels deep
dust -n 30 -d 2

The -n flag overrides the terminal height default when you want more or fewer rows. The -d flag controls recursion depth. Without -d, dust keeps drilling down until it finds the largest entries.

Filtering with the dust Command

# Show only directories, no files
dust -D

# Show only files
dust -F

# Ignore hidden files
dust -i

# Ignore specific directory name
dust -X node_modules

# Only show entries larger than 100M
dust -z 100M

The -X flag is great for skipping noisy directories like node_modules or .git. Combine it with -z to focus only on the big stuff.

Output Format Options

# Show full paths
dust -p

# Hide bars and percentages for clean output
dust -b

# Sort by file count instead of disk size
dust -f

# JSON output for scripting
dust -j

# Monochrome output (no colors)
dust -c

The -j flag is surprisingly useful. You can pipe the JSON output into jq for custom processing. I use this in monitoring scripts that check disk usage across servers.

Why Use the dust Command Over du

Here is the honest comparison. The du command has been around for decades. It is on every Linux system by default. It works. But there are three things that make the dust command better for everyday use.

Visual hierarchy. Dust shows you the tree relationship between directories using colored bars. With du, you get raw numbers and have to mentally map which directory contains what. Dust makes it obvious at a glance.

Smart defaults. Dust does not dump thousands of lines on you. It shows the biggest items and stops. The du equivalent would be du -d 1 -h | sort -h | tail -20. That is a lot of typing for a routine task.

Rust performance. Dust is fast. On directories with tens of thousands of files, it finishes noticeably quicker than du. If you work with large servers or media directories, you will feel the difference.

The same logic applies to other modern CLI tools. If you liked our bat command guide (a modern cat replacement) or the eza tutorial (modern ls), dust fits the same philosophy.

Real World Cases for the dust Command

I use the dust command in a few recurring scenarios. Here is what they look like when I run the dust command on a typical day.

Cleaning up Docker. Docker builds leave layers in /var/lib/docker. Running dust /var/lib/docker -d 2 shows me which images and containers are taking space. Usually one or two old builds are responsible for most of it.

Checking home directory. dust /home -n 15 -D shows the top 15 directories by size. I run this weekly on my NAS to spot runaway backups or forgotten downloads.

Server disk alerts. When a disk hits 90 percent, the dust command helps me find the culprit fast. dust / -x -d 1 -n 10 scans the root filesystem (-x keeps it on one filesystem) and shows the 10 largest top-level directories.

Configuring the dust Command

Dust supports a config file at ~/.config/dust/config.toml. Here is mine:

# ~/.config/dust/config.toml
reverse = true

Set reverse = true to show the largest entries at the bottom instead of the top. You can also set default flags here, though the format uses TOML keys rather than flag names. Check the --help output for the full list of configurable options.

No config file is required, but it is nice if you consistently use the same flags.

Wrapping Up

The dust command replaces du the same way bat replaces cat and fd replaces find. It does one thing and does it better. Visual output, smart defaults, and genuine speed improvements make it worth installing on every machine.

If you want to go deeper, check out the official dust GitHub repository for the full documentation and changelog. The OpenSource.com article on dust has a solid overview too.

Try it this week. Run dust / and see what you find.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts