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.
先审查再安装
这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。
npx -y tokrepo@latest install 82d22b5a-3745-11f1-9bc6-00163e2b0d79 --target codex先 dry-run,确认写入项后再运行此命令。
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.
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.
How to use
- Install dust:
brew install dust # macOS
cargo install du-dust # From source
- Show disk usage of the current directory:
dust
- 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
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 ┌── .
Related on TokRepo
- Coding tools — More CLI tools and developer utilities on TokRepo.
- Featured workflows — Discover curated developer tools.
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.
常见问题
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.
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.
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.
dust runs on macOS, Linux, and Windows. Install via Homebrew (macOS), cargo (all platforms), or download pre-built binaries from the GitHub releases page.
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.
引用来源 (3)
- dust GitHub— dust is a modern du replacement in Rust
- Command Line Rust Tools— Rust CLI tools ecosystem
- Linux man pages— Disk usage analysis best practices
TokRepo 相关
讨论
相关资产
Tauri — Smaller, Faster, More Secure Desktop Apps in Rust
Tauri lets you build smaller, faster, and more secure desktop and mobile applications with any web frontend. Rust backend + OS native WebView (no bundled Chromium) produces ~3MB binaries compared to Electron 150MB.
Rocket — A Web Framework for Rust with Focus on Usability
Rocket is a web framework for Rust that makes it simple to write fast, type-safe, secure web applications. Focuses on usability with derive macros, type-safe routing, request guards, and managed state. Intuitive yet powerful.
Sniffnet — Cross-Platform Network Traffic Monitor with Real-Time Charts
Sniffnet is an open-source application written in Rust that lets you monitor your internet traffic in real time with intuitive charts, detailed connection data, and custom alerts.
fd — A Simple Fast User-Friendly Alternative to find
fd is a simple, fast, and user-friendly alternative to the venerable find command. Written in Rust with smart defaults: color output, gitignore-aware, parallel traversal, and intuitive syntax. Used by VS Code, Helix, and many dev tools.