# 使用 Homebrew, Nix 安装 btdu

查看 btdu 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:btdu
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install btdu
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#btdu
```

  证据: nixpkgs package indexes: pkgs/by-name/bt/btdu/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:btdu
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/btdu>
- **版本:** 0.7.2
- **来源摘要:** Sampling disk usage profiler for btrfs
- **主页:** <https://github.com/CyberShadow/btdu>
- **仓库:** <https://github.com/CyberShadow/btdu>
- **上游文档:** <https://github.com/CyberShadow/btdu#readme>
- **许可证:** GPL-2.0-only
- **源码归档:** <https://github.com/CyberShadow/btdu/archive/refs/tags/v0.7.2.tar.gz>
- **最后更新:** 2026-07-03T15:25:04-04:00
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- btdu (cli)
- btdu (别名)

## 依赖

- ncurses

## 构建依赖

- btrfs-progs
- dub
- ldc

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 0.7.2
- 管理器更新时间: 2026-07-03
- 本地数据: OK
- 上游仓库: https://github.com/CyberShadow/btdu
- 检测到的最新版本: v0.7.2 (当前)
## 项目历史与用法

btdu is a sampling disk-usage profiler for btrfs. It exists because copy-on-write snapshots, reflinks, extent sharing, and compression make classic directory walkers like du and ncdu poor explanations of real btrfs space usage.

### 项目历史

CyberShadow started btdu in November 2020, with the first public release tag v0.1.0 shortly afterward. The project is written for the btrfs filesystem and uses sampling over filesystem space rather than a conventional recursive directory traversal.

The README explains that btdu samples random points in the disk space, asks btrfs what is stored there, records a representative path, and repeats indefinitely. The result is initially approximate but becomes progressively more accurate as sampling continues.

### 采用历史

btdu has a narrower audience than general disk analyzers, but the README documents several distribution paths: native distro packages where available, static binaries from GitHub releases, latest CI builds, Nix flakes, and source builds using the D compiler and Dub.

The Homebrew and Nix packaging in the input reflects that btrfs users often still want btdu available from cross-platform package managers even though its runtime target is btrfs rather than generic macOS storage.

### 使用方式

Users run btdu with root privileges against the top-level subvolume of a btrfs filesystem. It can launch an interactive terminal UI, run headless for scripts, export and import sampling results, compare baselines, and use expert or physical-space modes for deeper analysis.

### 为什么软件包爱好者会关心

btdu is significant because it packages filesystem theory into a small terminal tool. It is not another ncdu clone; it is a btrfs-specific answer to shared extents, compression, snapshots, unreachable extent fragments, and logical-versus-physical allocation.

### 时间线

- 2020: First git commit and v0.1.0 release.
- 2025: v0.6.0 release appears in git history.
- 2026: v0.7.2 release appears in git history.

### Related projects

- The README contrasts btdu with ncdu for classic disk-usage analysis.
- The README links compsize as a special-purpose btrfs compression-space tool.
- The README names btsdu, the Btrfs Snapshot Disk Usage Analyzer, in its See Also section.

### 来源

- Local git history from https://github.com/CyberShadow/btdu shows first commit in 2020 and release tags v0.1.0, v0.6.0, and v0.7.2.
- Official CONCEPTS.md explains logical versus physical space and btdu size metrics: https://raw.githubusercontent.com/CyberShadow/btdu/master/CONCEPTS.md
- Official README describes btdu as a sampling disk usage profiler for btrfs and explains the random sampling algorithm: https://raw.githubusercontent.com/CyberShadow/btdu/master/README.md
- Official README documents use cases, install paths, root/top-level-subvolume usage, headless mode, import/export, compare mode, and See Also: https://raw.githubusercontent.com/CyberShadow/btdu/master/README.md


## 安全说明

没有找到 btdu 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** btdu
- **Version Scheme:** 0
- **Revision:** 0
- **Requirements:** linux
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Nix - btdu: normalized package name match | nixpkgs package indexes: pkgs/by-name/bt/btdu/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Networking and protocol packages](https://www.automicvault.com/zh-hans/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Homebrew utility packages](https://www.automicvault.com/zh-hans/pkg/brew-utility-packages/) - Matched curated package taxonomy and local package facts.
- [ncurses](https://www.automicvault.com/zh-hans/pkg/brew/ncurses/) - Runtime dependency declared by Homebrew.
- [btrfs-progs](https://www.automicvault.com/zh-hans/pkg/brew/btrfs-progs/) - Build dependency declared by Homebrew.
- [dub](https://www.automicvault.com/zh-hans/pkg/brew/dub/) - Build dependency declared by Homebrew.
- [ldc](https://www.automicvault.com/zh-hans/pkg/brew/ldc/) - Build dependency declared by Homebrew.
- [apachetop](https://www.automicvault.com/zh-hans/pkg/brew/apachetop/) - Local package facts share a topical domain. Shared terms: ncurses.
- [center-im](https://www.automicvault.com/zh-hans/pkg/brew/center-im/) - Local package facts share a topical domain. Shared terms: ncurses.
- [dump1090-fa](https://www.automicvault.com/zh-hans/pkg/brew/dump1090-fa/) - Local package facts share a topical domain. Shared terms: ncurses.

## Combined YAML source

View the package source record on GitHub. [combined/btdu.yml](https://github.com/automic-vault/db/blob/main/combined/btdu.yml)


## 来源

- Nucleus package database
- package-page enrichment
- curated package history
- package version freshness
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
