Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Gdu – A Pretty Fast Disk Usage Analyzer for Linux - DesignLinux

Mar 31 2021
designlinux 0 Comments

In this article, we will take a look at gdu an open-source disk usage analyzer written in go. Gdu is inspired by godu, dua, ncdu, and df.

The gdu tool is created for SSD drives where parallel processing can be utilized. This tool can also work with HDD with less performance compared to SSD drives. You can also check benchmark results. There are many other similar tools and you have to play with gdu first to see if satisfy your needs.

How to Install Gdu – Linux Disk Usage Analyzer

There are few different ways to install gdu in different Linux flavors but I am going to stick with a common way that can be followed irrespective of what distribution you are running with.

Go to the gdu GitHub release page to download the archive file. The latest version is V4.9.1 and I suggest downloading the latest version.

$ curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz
$ chmod +x gdu_linux_amd64
$ sudo mv gdu_linux_amd64 /usr/bin/gdu

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

$ gdu --version

Version:        v4.9.1
Built time:     Sat Mar 27 09:47:28 PM  CET 2021
Built user:     dundee

A good practice before playing with any new tools is to check the help options.

$ gdu --help
Gdu Help Options
Gdu Help Options

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

$ gdu
Check Disk Usage of Home Directroy
Check Disk Usage of Home Directroy

To scan for any particular directories you have to pass the directory name as an argument.

$ gdu /home/tecmint/bash
Check Disk Usage of Directroy
Check Disk Usage of Directroy

You cannot pass more than one argument.

$ gdu /home /var

There are few operations you can perform with the gdu command. Press ? to access help.

Gdu Help and Usage
Gdu Help and Usage

From the help you can see, there are options to sort, scan and move across directories. Access help and try exploring all the options to get comfortable.

You can delete a file or directory by pressing the “d" key. It will prompt you for confirmation.

Delete File or Directory
Delete File or Directory

You can also view the content of any file by pressing the “v" key. To come out of the file press the escape key.

View File Content
View File Content

You can ignore certain directories from the output by adding directory names as an argument to the -i flag. Multiple directories can also be passed to the -i flag and each directory should be separated by commas.

$ gdu /home/karthick/ -i /home/karthick/.ssh,/home/karthick/sqlite

You may see special characters in the files and directories and each has a special meaning. From the below example you can see the “/network” directory is empty so the character “e” is prefixed to denote that.

[ ! ] ⇒ Error while reading directory
[ . ] ⇒ Error while reading subdirectory.
[ @ ] ⇒ File is socket or simlink.
[ H ] ⇒ Hardlink which is already counted.
[ e ] ⇒ Empty directory.
Special Characters Files
Special Characters Files

If you like black and white output, you can use “-c" flag. See the below image where the output is printed in black and white.

$ gdu -c /etc/systemd
Black and White Output
Black and White Output

All the commands till now will launch an interactive mode to show disk stats. If you want the output in non-interactive mode use the “-n" flag.

$ gdu -n ~
Non Interactive Output
Non Interactive Output

That’s it for this article. Play with gdu and let us know how it suits your needs compared to other disk usage tools.

Related

Tags: Analyzing Linux Disk Usage, commandline tools, Linux Disk Monitoring Tools

How to Install SQLite and SQLite Browser in Ubuntu

Prev Post

How to Configure FirewallD in RHEL, CentOS and Fedora

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 612
  • 1,055,384

DesignLinux.com © All rights reserved

Go to mobile version