In this tutorial, we will show you how to install Gdu Disk Analyzer on Ubuntu 20.04 LTS. For those of you who didn’t know, Gdu (Go Disk Usage) is very similar to Ncdu, a popular console disk usage analyzer, with one major difference: speed. Gdu makes use of parallel processing, being specially created for solid-state drives (SSD). It also works with hard disk drives (HDD), but its performance gain compared to other tools is not so great in this case.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Gdu Disk Analyzer on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Gdu Disk Analyzer on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade
Step 2. Installing Gdu Disk Analyzer on Ubuntu 20.04.
- Install Gdu Disk Usage Analyzer from the official repository.
Now we run the following command to download GDU from its Github repository using curl
:
curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz
Then, make it an executable file:
chmod +x gdu_linux_amd64
After that, move the file to the /usr/bin
directory:
sudo mv gdu_linux_amd64 /usr/bin/gdu
Now you can verify the installation by running the following command:
gdu --version
- Install Gdu Disk Usage Analyzer using Snap packages.
You may install GDU using Snap through it may seem like a lot of snap commands:
sudo apt install snapd sudo 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
Step 3. Analyze Disk Usage on Using Gdu.
Once successfully installed, let us quickly check the usage of various options it provides, just issue the ‘help’ option as an argument:
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]) -I, --ignore-dirs-pattern strings Absolute path patterns to ignore (separated by comma) -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) -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 -v, --version Print version
Congratulations! You have successfully installed Gdu. Thanks for using this tutorial for installing the Gdu Disk Analyzer on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official Gdu website.