

















September 7, 2025 | 1 分钟 | 156 字 | Tianlun Song | PR
现在使用 ncdu 的话,只需要执行一次就可以查询目录大小并排序,且删除文件也很方便,不会出错。
安装:
# ubuntu
sudo apt install ncdu
# centos
sudo yum install ncdu
# macOS
brew install ncdu
使用
# 统计当前所在目录及子目录的文件占用情况
ncdu
# 统计指定的 /data 目录
ncdu /data
# 将 /data 目录的情况输出到 ~/ncdu.txt
ncdu /data -o ~/ncdu.txt
# 加载本地根据,而不是进行实时统计
ncdu -f ~/ncdu.txt
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。