Gdu – Faster Disk Usage Analyzer for Linux - GeeksforGeeks

06 Jun, 2021
GDU is a disk usage analyzer written in Go language for the Linux Operating systems. Gdu was actually made for SSD disks where it can totally utilize parallel processing. Although it works for HDDs too, but the performance gain is not so good.GDU can run in two modes one is interactive and another is non-interactive. It is a good tool to analyze disk but it has many alternatives like the ncdu, godu, du, duc. Now let’s see how to install the GDU on a Linux system.
GDU provides multiple ways to install the GDU on your system according to your Linux distro, you can check all methods from their GitHub repository. But for now, let’s see the common method to install the GDU using the curl command.
Use the following commands to install  GDU 
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/gdu
Now we have installed the GDU on our Linux system. You can verify the installation of GDU using the following command:
 gdu --version
Then you will see the installed version of the GDU
Now let’s see how to analyze the disk using the GDU
To analyze the current working directory just run the gdu command on the terminal. Then it will show the disk usage by files in the current directory. Now I am in the /home/nishant/codes/bash directory.
gdu
Then you will see output like the:
To analyze the specific directory you can mention the path of the directory after the gdu command like this:-
gdu   /lib/apt/
Then you will see the output:-
Note that we can provide only one argument to the gdu. Now let’s see options to use interactive mode.
GDU provides the options to use GDU more effectively in interactive mode. To see all options press ?  Key on the keyboard. Now we can see the options using which we can move the cursor up/down, select and delete directories or files using keys like J , G , l , h , etc .
We can delete the selected file by pressing the d key on the keyboard
You can also view the content of a file by pressing the v key on the keyboard
  Did you observe the flags like e , ! , . , @, H,e before the file names ? Each of the flags has a different meaning, let us see the meaning of each flag
!   -> An Error appeared while reading directory 
.   -> An Error appeared while reading subdirectory.
@   -> File is a socket or simlink.
H   -> Hardlink(File) which was already counted.
e   -> An Empty directory.
 Now let’s see some other options provided by GDU. We can see all option provided by the GDU using the help command as follows:
gdu --help
Now let’s see how to use these options
-c options 
              By using this option we can print the output in black and white color.
gdu -c directory_path
-n options
If you want the outputs in the non-interactive form then you can use the flag “n”  
gdu -n directory_path
Kali-Linux
Linux-Tools
Linux-Unix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
scp command in Linux with Examples
nohup Command in Linux with Examples
mv command in Linux with examples
Thread functions in C/C++
Docker - COPY Instruction
chown command in Linux with Examples
nslookup command in Linux with Examples
SED command in Linux | Set 2
Named Pipe or FIFO with example C program
uniq Command in LINUX with examples