Install gdu on Ubuntu 20.04

Install gdu on Ubuntu 20.04

The gdu is a command line tool for viewing and analyzing disk space usage. The gdu is similar to the ncdu command, but gdu is faster to scan a data on storage device like shown in benchmarks section in the GitHub repository. The gdu is written using Go programming language.

This tutorial demonstrates how to install gdu on Ubuntu 20.04.

Install gdu

Run the following command to download latest version of gdu from GitHub:

wget -O gdu.tgz https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz

Extract downloaded tgz file:

tar xf gdu.tgz

Move binary file to the /usr/local/bin directory:

sudo mv gdu_linux_amd64 /usr/local/bin/gdu

Now gdu command can be used for all users.

We can check gdu version:

gdu --version

The tgz file is no longer needed, so remove it:

rm -rf gdu.tgz

Testing gdu

Run the gdu command without any argument if you want to check disk space usage in the current working directory:

gdu

Arrow keys can be used to navigate the list. We can delete files or directories with d key. Press q key to exit gdu.

We can view disk space usage of a particular directory by specifying the directory path as argument. The following command performs analysis of root directory:

sudo gdu /
Disk space usage of root directory using gdu on Ubuntu

Uninstall gdu

If gdu is no longer necessary, remove related file:

sudo rm -rf /usr/local/bin/gdu

Leave a Comment

Cancel reply

Your email address will not be published.