Jump to content

(Guide/Review) GDU is a command line tool that helps you find the disk usage of a folder or drive


Karlston

Recommended Posts

GDU is a command line tool that helps you find the disk usage of a folder or drive

 

When my computer is running low on storage space, I use a program like TreeSize Free (Martin prefers WizTree) to check what's taking up the most amount of space, and move the content to my external drives. Such applications tend to be heavy on resources, and have a lot of options, some of which you may never use.

 

GDU is a command line tool that helps you find the disk usage of a folder or drive

 

GDU is a terminal based disk usage analysis tool that is lightweight and easy to use.

 

The program is portable, extract it to a folder after the download to get started. Since it does not have an interface, you will need to open a Command Prompt window and run GDU from it.

 

GDU example usage

 

Let's scan a drive, for this we need to enter GDU <DRIVE NAME>. For example, if we want to scan the C drive, we'll use GDU C:. The program will scan the drive and display the results in just a couple of seconds. GDU has a colorized command window, which makes it easy to distinguish folders from files. There is a monochrome mode that you can activate using GDU -c. E.g. GDU -c C:\.

 

GDU monochrome mode

 

The bar at the bottom of the screen tells you the total disk usage, and the file count. The command to scan a folder is similar to the one we used above, type GDU <FOLDER PATH>. Replace the folder path with the actual path like GDU C:\Users\Ashwin\Documents\. The program will list all directories in the folder, with their file size. The number at the top of the list indicates the total disk usage of the current folder. You can switch between actual usage (size on disk) and apparent usage size, with the a key.

 

Use the up and down arrow keys to navigate the list. Hit the Enter key to open the selected folder. This way you can find the disk usage of sub-folders individually. So, in a way GDU is sort of a file manager. To go back to the previous folder, tap the h key.

 

You may sort the directory by name with the n key, or by size with s. Tap the keys twice to switch between ascending and descending order. Did you notice that I have used lowercase for the key's names? That's because the shortcuts are case-sensitive. e.g. C will sort the items by file count, but c toggles the file count information.

 

GDU can open text files, to do so, select the document and press v. Use the Escape key to exit the file view mode.

 

Pressing the d key will delete the selected file or folder, the program warns you about this and asks for your confirmation before deleting the content. I advise paying attention to this option, else you could lose important data. When you're done with GDU, press the q key to exit the program.

 

GDU export file list to text document

 

You can export the data to a file, like a text document. The command for this is GDU > list.txt C:\. Replace "List" with a file name of your choice, and GDU will save the list of files and folders to a text document in its folder. Type ? to view the help file to view more commands.

 

GDU help file

 

GDU is an open source utility written in GO. It supports Windows, and Linux. The program's best feature is its speed, thanks to the fact it doesn't have an interface, switching to folders is an instantaneous process.

 

Landing Page: https://github.com/dundee/gdu

 

 

GDU is a command line tool that helps you find the disk usage of a folder or drive

Link to comment
Share on other sites


  • Views 1.1k
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...