Skills2026年4月14日·1 分钟阅读

duf — Disk Usage/Free Utility Made Beautiful

duf replaces the classic `df` command with a colorful, human-readable table showing disk usage across all your mounts. Better ergonomics, clearer layout, and zero learning curve.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
先审查命令
npx -y tokrepo@latest install 06fa0bc0-3859-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
duf replaces the df command with a colorful, human-readable disk usage table across all mounts with zero learning curve.
§01

What it is

duf is a modern replacement for the classic Unix df command. It displays disk usage and free space in a colorful, well-formatted table that is easier to read than df's raw output. It automatically groups local devices, network mounts, and special filesystems into separate sections.

The tool targets system administrators, DevOps engineers, and any developer who checks disk space regularly. It runs on Linux, macOS, and Windows with no dependencies.

§02

How it saves time or tokens

Reading df output requires mentally parsing aligned columns with raw byte counts. duf presents the same data in a formatted table with color-coded usage bars, human-readable sizes (GB/TB), and clear grouping by filesystem type. You get the answer at a glance instead of squinting at numbers.

§03

How to use

  1. Install duf via your package manager.
  2. Run duf in the terminal.
  3. Optionally filter by mount point or filesystem type.
# Install
brew install duf        # macOS
sudo apt install duf    # Debian/Ubuntu
scoop install duf       # Windows

# Basic usage
duf

# Show only local devices
duf --only local

# Show specific path
duf /home

# JSON output for scripting
duf --json
§04

Example

$ duf --only local

+-------+--------+--------+--------+------+----------+
| Mount |  Size  |  Used  | Avail  | Use% | Type     |
+-------+--------+--------+--------+------+----------+
| /     | 256 GB | 142 GB | 114 GB |  55% | ext4     |
| /boot |   1 GB | 312 MB | 712 MB |  30% | ext4     |
| /home | 512 GB | 287 GB | 225 GB |  56% | ext4     |
+-------+--------+--------+--------+------+----------+

(Actual output includes color bars and better formatting)
§05

Related on TokRepo

§06

Common pitfalls

  • On systems with many network mounts (NFS, CIFS), duf can hang while querying unresponsive mounts. Use --only local to skip network filesystems.
  • The JSON output format (--json) differs from df's output format, so existing scripts parsing df output need adjustment if migrating.
  • Some minimal container images do not include the /proc/mounts information duf needs. Running duf inside a container may show incomplete results.

常见问题

Does duf work on all operating systems?+

Yes. duf runs on Linux, macOS, FreeBSD, and Windows. It is a single binary with no external dependencies. Installation is available through most package managers including Homebrew, apt, pacman, scoop, and choco.

Can I use duf in scripts?+

Yes. duf provides a --json flag that outputs structured JSON data suitable for parsing in scripts. You can also use --output to select specific columns and --sort to control the sort order for scripted processing.

How does duf differ from ncdu or dust?+

duf replaces df (shows filesystem-level usage per mount point). ncdu and dust replace du (shows file and directory-level usage within a path). They serve different purposes. Use duf to check overall disk space; use ncdu or dust to find which files consume space.

Does duf support color themes?+

duf uses colors based on your terminal's color scheme. It supports 256-color and truecolor terminals. If colors are not rendering correctly, check that your terminal emulator supports the expected color mode. You can also use --no-color to disable colors.

Is duf actively maintained?+

Yes. duf is actively maintained on GitHub with regular releases. It is written in Go, which ensures easy cross-compilation and minimal runtime dependencies. The project accepts community contributions and bug reports.

引用来源 (3)
  • duf GitHub— duf is a better df alternative with colorful output
  • duf README— duf supports JSON output for scripting and multiple OS platforms
  • Linux man pages— The df command displays filesystem disk space usage

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产