Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 13, 2026·3 min de lecture

dust — A More Intuitive Version of du in Rust

dust (du + Rust = dust) is a modern replacement for the du disk usage command. It provides a visual, color-coded tree view of directory sizes, instantly showing which folders and files consume the most disk space.

Prêt pour agents

Installation avec revue préalable

Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
step-1.md
Commande avec revue préalable
npx -y tokrepo@latest install 82d22b5a-3745-11f1-9bc6-00163e2b0d79 --target codex

Dry-run d'abord, confirmez les écritures, puis lancez cette commande.

TL;DR
dust shows disk usage as a color-coded visual tree, instantly revealing the largest directories.
§01

What it is

dust (du + Rust = dust) is a modern replacement for the du disk usage command. It provides a visual, color-coded tree view of directory sizes, instantly showing which folders and files consume the most disk space.

dust is part of the Rust CLI renaissance alongside bat, fd, ripgrep, and eza: modern, fast alternatives to traditional Unix tools. It answers 'what is using all my disk space?' in a single command without piping through sort and head.

§02

How it saves time or tokens

Traditional du requires piping through sort and head to find the largest directories: du -sh * | sort -rh | head -20. ncdu requires interactive navigation. dust shows everything in a single command with proportional visual bars. The output is instantly readable without scrolling or interaction. For AI agents analyzing disk usage, dust's structured output is more parseable than du's raw numbers.

§03

How to use

  1. Install dust:
brew install dust              # macOS
cargo install du-dust           # From source
  1. Show disk usage of the current directory:
dust
  1. Common options:
dust -n 10              # Show only top 10 entries
dust /home/user          # Show specific directory
dust -r                  # Reverse order (smallest first)
dust -s                  # Show apparent size (not disk usage)
dust -d                  # Only show directories (not files)
dust -X .git -X node_modules  # Exclude directories
§04

Example

Typical dust output showing proportional bars:

$ dust -n 8

  4.2G ┌── node_modules      ████████████████████████████████ 48%
  2.1G ├── .git               ████████████████ 24%
  1.0G ├── dist                ████████ 11%
512.0M ├── data                ████ 6%
256.0M ├── logs                ██ 3%
128.0M ├── assets              █ 1%
 64.0M ├── docs                █ 1%
 32.0M ├── src                  0%
  8.8G   ┌── .
§05

Related on TokRepo

§06

Common pitfalls

  • Running dust on the root directory without --depth limit produces an overwhelming amount of output. Use -n to limit entries or -d to hide files.
  • dust shows disk usage by default, which differs from apparent file size due to filesystem block allocation. Use -s for apparent size if you need the actual file sizes.
  • On macOS, some system directories require sudo to scan. Run sudo dust /Library if you need to audit system storage.

Questions fréquentes

How does dust differ from du?+

dust provides a visual, color-coded tree with proportional bars. du outputs raw numbers that require piping through sort and head. dust is significantly more readable for finding the largest directories at a glance.

How does dust compare to ncdu?+

ncdu is interactive and requires navigating through directories manually. dust shows the full picture in a single non-interactive command. For scripting and quick lookups, dust is faster. For deep exploration, ncdu offers more interactivity.

Can I exclude directories from the scan?+

Yes. Use the -X flag to exclude directories: dust -X .git -X node_modules. This is useful for excluding known large directories that are not relevant to your analysis.

What platforms does dust support?+

dust runs on macOS, Linux, and Windows. Install via Homebrew (macOS), cargo (all platforms), or download pre-built binaries from the GitHub releases page.

Is dust fast on large filesystems?+

Yes. Written in Rust, dust scans directories efficiently using parallel I/O. It is faster than du on most filesystems and handles large directory trees without issues.

Sources citées (3)

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires