Spread the love

In this article we will look at the gdu program. It is an analyzer of the used disk space and is open source.

The gdu tool is designed for SSDs where parallel processing can be used. This tool can also work with HDDs with lower performance compared to SSDs. You can also check the results of the benchmark. There are many other similar tools and you must first play with gdu to see if it meets your needs.

How to install

# 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/gduCode language: PHP (php)
# Arch Linux:
yay -S gduCode language: PHP (php)
# Debian:
dpkg -i gdu_*_amd64.debCode language: CSS (css)
# Ubuntu
add-apt-repository ppa:daniel-milde/gdu
apt-get update
apt-get install gduCode language: PHP (php)
# NixOS:
nix-env -iA nixos.gduCode language: CSS (css)
# Homebrew:
brew install -f gdu
brew link --overwrite gdu  # if you have coreutils installed as wellCode language: PHP (php)
# Snap:
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 gduCode language: CSS (css)
# Binenv:
binenv install gduCode language: PHP (php)
# Go:
go get -u github.com/dundee/gdu/v4Code language: PHP (php)

Now you can verify the installation by running the following command.

# Check Version
gdu --versionCode language: PHP (php)

Usage:

If you run the gdu command without an argument, it will scan your current working directory. I am now in my home directory and when I start gdu, you can see from the image below that my home directory is being scanned.

# Examples
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 -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 modeCode language: PHP (php)
gdu examples

Quick install and review video

Alternatives

We hope you enjoyed this article. if that is so please rate this page with the stars bellow and subscribe to our YouTube channel.

Leave a Reply