Dfdu:适用于终端和桌面的快速磁盘占用浏览工具
Dfdu: Fast disk usage browser for the terminal and desktop

原始链接: https://github.com/jordond/dfdu

dfdu 是一款适用于终端和桌面的快速磁盘占用情况浏览工具。它并行扫描存储空间,可在扫描完成前开始浏览,并提供矩形树图、树形视图、重复文件、最大文件、排序和删除功能。其清理视图会检测缓存、构建目录、SDK、旧安装程序及其他可移除项,并评估安全性和潜在可节省空间;规则可扩展。扫描结果会被缓存,并以增量方式重新运行,还通过历史记录查看随时间增长的内容。它支持 SSH 浏览/删除、带命令面板的跨平台桌面图形界面、JSON/NDJSON 输出、CI 体积限制以及 ncdu 导入/导出。删除默认移至回收站,永久删除需要输入“delete”,--read-only 会禁用删除按键。可通过 curl 脚本、Homebrew、Arch 软件包、PowerShell、cargo、Nix 或发布版二进制文件安装;也提供桌面端安装方式。示例命令包括 dfdu ~、dfdu --disks、dfdu report ~/dev、dfdu clean ~/dev 和 dfdu diff ~ --since 7d。采用 MIT 许可。

Hacker News 上关于 Dfdu(一款用于终端和桌面的快速磁盘占用浏览工具)的讨论总体积极,但也很务实。评论者称赞它的 TUI/桌面双界面、清理视图和可视化效果,同时将其与 ncdu、gdu、TreeSize 以及几款自研工具进行了比较。基准测试结果不一:一位用户发现 dfdu 在大型项目/主目录上比 ncdu 更快,但也有人报告它在巨大目录树上比 gdu 慢得多。几位用户分享了替代方案:Getǣl,一款具有多种视图并支持 Time Machine 的 Rust 主目录可视化工具;duls,一款带丰富上下文且有时间限制的扫描器;用于缓存清理的 ocy;以及一款 APFS CoW 去重工具。有人请求为 Getǣl 添加 ZFS 快照支持。担忧包括 curl|sh 安装方式、依赖更新机器人让提交历史变得杂乱,以及一个 Windows bug 会把小文件显示为 EiB。作者表示更推荐使用包管理器,并计划将 Renovate 更新分组。
相关文章

原文
dfdu

CI Release crates.io License: MIT MSRV OpenSSF Scorecard

A disk usage browser for the terminal and the desktop. Browse, sort and delete, see what your space is made of (caches, build output, emulators, containers), and get a list of what is safe to remove.

Browsing a home directory, the treemap and the cleanup view

  • Fast. Parallel scanning tuned to the storage device, and you can start browsing before it finishes.
  • Cleanup view. Recognises caches, build folders, SDKs and old installers, says how safe each is to delete and how much it frees. Rules are extendable.
  • Treemap, tree mode, duplicates and largest files, one key away from the list.
  • Opens last time's scan at once. A repeat dfdu PATH shows the cached scan and refreshes only what changed.
  • History. Every scan is recorded, so you can ask what grew since last week.
  • Remote. Browse and delete on another machine over ssh.
  • Desktop app. The same browser in a window for macOS, Linux and Windows, with the same keys as the terminal browser and a command palette.
  • Scriptable. JSON and NDJSON output, a CI mode that fails above a size limit, and ncdu export import.
  • Safe by default. Deletes go to the Trash; permanent deletes ask you to type delete. --read-only removes the delete keys.
curl -fsSL https://dfdu.app/install.sh | sh                 # macOS, Linux
brew install jordond/tap/dfdu                               # macOS, Linux
yay -S dfdu-bin                                             # Arch Linux

Windows:

powershell -ExecutionPolicy Bypass -c "irm https://github.com/jordond/dfdu/releases/latest/download/dfdu-installer.ps1 | iex"

The desktop app:

brew install --cask jordond/tap/dfdu-gui                    # macOS
curl -fsSL https://dfdu.app/install.sh | sh -s -- --gui     # macOS, Linux, with the CLI

The install docs cover release binaries, cargo, Nix, the install script's options, and the desktop app's downloads for Linux and Windows.

With an AI assistant, paste this prompt:

Install dfdu for me. Follow the instructions at https://dfdu.app/llms.txt and pick the method that fits this machine.
dfdu ~                    # browse a directory
dfdu --disks              # pick a disk first
dfdu --remote server /srv # another host over ssh

Keys follow ncdu. Press ? in the app for the full list, or see Browsing.

dfdu report ~/dev         # what the cleanup rules found
dfdu clean ~/dev          # dry run of the recommended deletes
dfdu diff ~ --since 7d    # what grew in the last week

Command line has the commands for scripts and CI, with JSON output and size limits.

  • Install: every install method, options and uninstalling
  • Browsing: keys, views, mounts and the scan cache
  • Command line: the commands for scripts and CI
  • Desktop app: installing and using the desktop app
  • Cleanup rules: the built-in rules and how to write your own
  • Themes: five built-in themes and custom TOML themes
  • Benchmarks: scan time and memory against other tools
  • Contributing: building, testing and releasing

Other disk usage tools worth a look:

  • ncdu: the classic ncurses disk usage browser, whose keys dfdu follows
  • gdu: a fast disk usage analyzer with a console interface, written in Go
  • dua: disk usage analyzer with an interactive mode, written in Rust
  • Dust: a more intuitive version of du, written in Rust
  • pdu: parallel disk usage, written in Rust

MIT

联系我们 contact @ memedata.com