The gdu is a command line tool that allows to view and analyze 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 explains how to install gdu on Raspberry Pi.
Connect to Raspberry Pi via SSH and download the latest gdu release from GitHub. Then extract downloaded tar.gz
file.
wget -O gdu.tgz https://github.com/dundee/gdu/releases/latest/download/gdu_linux_armv7l.tgz
tar xf gdu.tgz
Move binary file to the /usr/local/bin
directory and add execute permission to the file.
sudo mv gdu_linux_armv7l /usr/local/bin/gdu
sudo chmod a+x /usr/local/bin/gdu
Now gdu is available for all users as a system-wide command. We can check gdu version as follows:
gdu --version
The tar.gz
file is no longer needed and we can remove it:
rm -rf gdu.tgz
To check disk space usage in the current working directory, run the gdu
command without any argument:
gdu
Arrow keys can be used to navigate the list. Press the d
key if you want to delete files or directories. Press q
key to quit gdu.
We can specify the directory path as argument in order to view disk space usage of a particular directory. The following command performs analysis of root directory:
sudo gdu /
If gdu is no longer necessary, remove the binary file:
sudo rm -rf /usr/local/bin/gdu
Leave a Comment
Cancel reply