Pretty fast disk usage analyzer written in Go.
Gdu is intended primarily for SSD disks where it can fully utilize parallel processing. However HDDs work as well, but the performance gain is not so huge.
Head for the releases and download binary for your system.
Using curl:
curl -L https://github.com/dundee/gdu/releases/latest/download/gdu-linux-amd64.tgz | tar xz
chmod +x gdu-linux-amd64
mv gdu-linux-amd64 /usr/bin/gdu
yay -S gdu
Debian:
dpkg -i gdu_*_all.deb
nix-env -iA nixos.gdu
brew install gdu
Snap:
snap install gdu-disk-usage-analyzer
snap alias gdu-disk-usage-analyzer.gdu gdu
Go:
go get -u github.com/dundee/gdu
gdu [flags] [directory_to_scan]
Flags:
-h, --help help for gdu
-i, --ignore-dirs strings Absolute paths to ignore (separated by comma) (default [/proc,/dev,/sys,/run])
-l, --log-file string Path to a logfile (default "/dev/null")
-c, --no-color Do not use colorized output
-p, --no-progress Do not show progress
-n, --non-interactive Do not run in interactive mode
-d, --show-disks Show all mounted disks
-v, --version Print version
gdu # analyze current dir
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 -c / # use only white/gray/black colors
gdu -n / # only print stats, do not start interactive mode
gdu -np / # do not show progress either
gdu / > file # write stats to file, do not start interactive mode
Gdu has two modes: interactive (default) and non-interactive.
Non-interactive mode is started automtically when TTY is not detected (using go-isatty), for example if the output is being piped to a file, or it can be started explicitly by using a flag.
make test
Scanning 80G of data on 500 GB SSD.
Tool | Real time without cache | Real time with cache | CPU time without cache (user + sys) |
---|---|---|---|
gdu / | 6.5 | 2 | 15 (8 + 7) |
dua / | 7.5 | 2 | 17 (4 + 13) |
godu / | 8 | 3 | 23 (11 + 12) |
nnn -T d / | 31 | 3 | 7.2 (0.3 + 6.9) |
du -hs / | 32 | 4 | 8.6 (0.9 + 7.7) |
duc index / | 34 | 4.5 | 11.3 (2.5 + 8.8) |
baobab / | 38 | 12 | 25 (16 + 9) |
ncdu / | 43 | 13 | 18.5 (1.5 + 17) |