Analyze Disk Usage Using GDU Command Line Tool
This article will quilt a information on the use of the “gdu” command line application in Linux. This instrument can be utilized to research unfastened as smartly used area on any garage tool hooked up in your Linux gadget. Written in Go programming language, gdu claims to be rapid at examining cast state drives. According to a benchmark equipped on its GitHub repository, it could actually analyze a complete disk quicker than different identical gear.
Main Features of Gdu
Gdu can analyze unfastened and used area of whole disks or it could actually in finding measurement details about person information and directories. It too can forget about particular directories in order that they’re excluded from disk utilization research. Gdu supplies a command line possibility the place you’ll be able to allot CPU cores to hurry up the research procedure. Other major options of gdu come with skill to supply coloured output for higher clarity, skill to forget about hidden information and folders, an non-compulsory interactive mode, skill to research exterior drives hooked up to a Linux gadget, and skill to export findings to an exterior record in JSON layout.
Installing Gdu in Linux
You can set up gdu in Linux through downloading legit Linux applications equipped through builders of the app. These applications have compatibility with a large number of Linux distributions and {hardware} architectures. Universal executable binaries that paintings on all Linux distributions also are to be had. You can obtain those applications and binaries from the gdu releases web page on GitHub. Further set up directions are to be had right here.
Using Gdu Command in Linux
To display measurement of all information and folders positioned in present listing, run the next command (assuming that you’ve got downloaded executable binary for amd64 structure):
If you put in a gadget huge gdu bundle, you several want to simply run the next command to get listing data:
Depending for your present listing, you may even see some output very similar to this:
In this interactive mode, you’ll be able to scroll thru entries the use of arrow keys at the keyboard in addition to throughout the mouse wheel. You can navigate to any indexed listing through hitting
If you simply need to get disk utilization data in non-interactive mode, run the similar command with “-np” transfer:
To display details about any particular listing, provide its trail to the gdu command in interactive or non-interactive mode. Here are two instance instructions appearing utilization for each modes:
$ ./gdu_linux_amd64 -np “$HOME/nltk_data”
To display the entire measurement of a listing with out record its contents, use the “-nps” transfer.
$ ./gdu_linux_amd64 -nps “$HOME/nltk_data”
To forget about hidden folders, use the “-H” command line possibility.
To forget about a selected listing or a couple of folders, you’ll be able to use the “-i” command line possibility and provide area separated absolute paths. Here is an instance command:
$ ./gdu_linux_amd64 -np -i “$HOME/nltk_data/corpora/wordnet”
You can change the listing trail in above command with every other absolute trail.
To display unfastened and used area on all interior and exterior units hooked up in your Linux gadget, use gdu command with “-d” command line transfer:
Depending on configuration of your Linux gadget, you may even see some output very similar to this:
This is in interactive mode, so you’ll be able to get admission to the contents of every force and test the sizes of person information and folders as smartly. To get similar data in non-interactive mode, use the next command:
$ ./gdu_linux_amd64 -npsd
To export analyzed effects to a JSON record, use the “-o” command line possibility. Here is an instance:
$ ./gdu_linux_amd64 “$HOME/nltk_data” -o information.json
You can change the listing trail in quotes with every other absolute trail of your selection. You can use any filename after “-o” command line transfer to export findings.
For extra details about gdu and its command line choices, use the next command:
$ ./gdu_linux_amd64 –help
Conclusion
Gdu is a quick disk utilization examining instrument this is specifically optimized for cast state drives. Though it really works with conventional arduous drives as smartly, its efficiency enhancements and research velocity are particularly noticeable on cast state drives. Its interactive mode is rather helpful for locating record sizes whilst navigating up and down thru directories.