Jump to content

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


Karlston
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

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