命令一共有两个:
du
该命令不用安装,为系统自带,常用的命令为:
du --max-depth=1 -h
gdu
重点说一下这个,很直观。首先是安装:
Using curl:
|
1 2 3 |
curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz chmod +x gdu_linux_amd64 sudo mv gdu_linux_amd64 /usr/bin/gdu |
wget:
|
1 2 3 4 |
wget https://gitee.com/public_sharing/tools_link/raw/master/gdu.zip unzip gdu.zip chmod +x gdu sudo mv gdu /usr/bin/gdu |
|
1 2 |
yay -S gdu |
|
1 2 |
dpkg -i gdu_*_amd64.deb |
|
1 2 3 4 |
sudo add-apt-repository ppa:daniel-milde/gdu sudo apt-get update sudo apt-get install gdu |
|
1 2 |
nix-env -iA nixos.gdu |
|
1 2 3 |
brew install -f gdu brew link --overwrite gdu # if you have coreutils installed as well |
Snap:
|
1 2 3 4 5 |
snap install gdu-disk-usage-analyzer snap connect gdu-disk-usage-analyzer:mount-observe :mount-observe snap connect gdu-disk-usage-analyzer:system-backup :system-backup snap alias gdu-disk-usage-analyzer.gdu gdu |
|
1 2 |
binenv install gdu |
Go:
|
1 |
go get -u github.com/dundee/gdu/v5/cmd/gdu |
用法:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Read config from file (default is $HOME/.gdu.yaml) -g, --const-gc Enable memory garbage collection during analysis with constant level set by GOGC --enable-profiling Enable collection of profiling data and provide it on http://localhost:6060/debug/pprof/ -h, --help help for gdu -i, --ignore-dirs strings Absolute paths to ignore (separated by comma) (default [/proc,/dev,/sys,/run]) -I, --ignore-dirs-pattern strings Absolute path patterns to ignore (separated by comma) -X, --ignore-from string Read absolute path patterns to ignore from file -f, --input-file string Import analysis from JSON file -l, --log-file string Path to a logfile (default "/dev/null") -m, --max-cores int Set max cores that GDU will use. 8 cores available (default 8) -c, --no-color Do not use colorized output -x, --no-cross Do not cross filesystem boundaries -H, --no-hidden Ignore hidden directories (beginning with dot) --no-mouse Do not use mouse --no-prefix Show sizes as raw numbers without any prefixes (SI or binary) in non-interactive mode -p, --no-progress Do not show progress in non-interactive mode -n, --non-interactive Do not run in interactive mode -o, --output-file string Export all info into file as JSON -a, --show-apparent-size Show apparent size -d, --show-disks Show all mounted disks -B, --show-relative-size Show relative size --si Show sizes with decimal SI prefixes (kB, MB, GB) instead of binary prefixes (KiB, MiB, GiB) -s, --summarize Show only a total in non-interactive mode -v, --version Print version --write-config Write current configuration to file (default is $HOME/.gdu.yaml) |
例子:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
gdu # analyze current dir gdu -a # show apparent size instead of disk usage gdu <some_dir_to_analyze> # analyze given dir gdu -d # show all mounted disks gdu -l ./gdu.log <some_dir> # write errors to log file gdu -i /sys,/proc / # ignore some paths gdu -I '.*[abc]+' # ignore paths by regular pattern gdu -c / # use only white/gray/black colors gdu -n / # only print stats, do not start interactive mode gdu -np / # do not show progress, useful when using its output in a script gdu / > file # write stats to file, do not start interactive mode |
把扫描结果保存到本地:
gdu -o /Users/mcj/Downloads/result.json
加载扫描结果:
gdu -f /Users/mcj/Downloads/result.json




最新评论
博主好,路过留言交流一下~我在做源头中转 Twinkle Model(利益相关):GPT 1折、国模 1折(GLM/DeepSeek/Kimi)、满血 Claude,低价稳定。价格全在模型广场 https://big-model.smart-agi.com/model-plaza ,有兴趣可以看看。
博主分享的 Surge 增强模式接管应用分流思路很赞!确实,系统大版本升级后,老牌 Proxifier 由于底层驱动兼容性问题经常莫名崩溃。在 Mac 上有 Surge 这种神器接管,但是在 Windows 平台上,很多人又很难找到兼顾‘轻量分流+稳定不崩溃’的工具:ProxiFyre 依赖 WireSock 内核驱动容易蓝屏且纯命令行,开 TUN 虚拟网卡又会把开发网段和公司 VPN 改乱。 如果是 Windows 用户寻找 Proxifier 替代品,非常推荐关注 Ghost Proxifier Pro: - 纯用户态 Winsock API Hook:完全免安装内核驱动和虚拟网卡,零蓝屏隐患,不改动系统默认网关与路由表; - 智能递归子进程树:很多现代客户端(如播放器、流媒体套件、IDE)会派生子进程,它能自动递归识别并接管流量,杜绝漏代理; - 现代 Fluent 图形界面:直接拖入目标 exe 即可一键绑定 SOCKS5/HTTP 节点,比老版配置规则直观很多。 注:该工具为非开源的独立客户端软件。 - 官网主页:https://ghostproxifier.com - 项目发布:https://github.com/liliBestCoder/ghost-proxifier-pro
曾经最爱之一,还有emlog,zblog
感谢分享经验,谢谢站长!!已收藏
牛牛牛
同样
站长您好,亚马逊云咨询推广资源,望建立联系,可邮件,谢谢。
换友情链接吗?