7 Great Apps to View Disk Usage in Linux
Pinterest Stumbleupon Whatsapp
Advertisement

Where does the space go? How has your two-terabyte hard disk drive filled up so quickly? There’s only one way to find out: with a disk usage viewing tool. These are mostly designed to work with hard disk drives and solid state drives How Do Solid-State Drives Work? [MakeUseOf Explains] How Do Solid-State Drives Work? [MakeUseOf Explains] Over the past few decades, there has been a considerable amount of work in the field of computer hardware. While computer technology is constantly improving and evolving, rarely do we experience moments where we simply... Read More , but they can also work with flash drives, USB sticks and SD cards.

Several such utilities are available for Linux, so let’s take a look at them.

1. Native Command Line Tools

The first place to check is the command line. Several tools are available here, and are already bundled with Linux.

The first command you should try is df. This will report the amount of disk space in use. It can be used alone, to display a full total for all mounted file systems, or with a filename.

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools terminal2

When used with a filename, df will output the remaining space on the specific partition where the file is stored.

df etc

The above command would show how much free space is available in the /etc/ directory. Meanwhile,

df -h

employs the -h switch, which means “human readable.” This basically displays the file and folder sizes in a format you can read. Use this to interpret how much disk space is being used by a particular file or directory.

Meanwhile, du is also available. Differing slightly to df, du displays an estimate of disk space used by files. For example,

du -shc *.txt

displays the size of each TXT file in the current directory in human-readable format.

You can also use the ls (list) command to output a list of a directory’s contents, and the file size.

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools terminal

This is done in any directory with

ls -l -h

Simple!

2. Ncurses Disk Usage (ncdu)

If you prefer to get the disk usage information you’re looking for from a dedicated utility, then try ncdu. Potentially the simplest method in this list, ncdu scans your system as soon as the tool is launched. By default, the contents and usage of the Home directory are displayed, but this can be changed by specifying a different directory as a parameter.

You can install ncdu on Debian-based systems via the command line:

sudo apt install ncdu

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools ncdu

Using ncdu is simple. In the command line, enter:

ncdu

You’ll need to wait for the results on larger HDDs. You can also scan the root filesystem using the -x command:

ncdu -x /

And there’s the option to scan via SSH — very useful for remote devices.

ssh -C user@system ncdu -o- / | ./ncdu -f-

Head to the ncdu website to find a full set of instructions.

Other features of ncdu include sorting by filename or size, deleting single files and directories, showing information about a file or folder, and toggling the visibility of hidden items.

With such good command line tools, you might think you’ve got everything you need. However, various visual tools will give you an enhanced view of your disk usage.

3. QDirStat

The first visual disk usage tool to look at is QDirStat, available across Linux desktop environments, as well as BSD Linux vs. BSD: Which Should You Use? Linux vs. BSD: Which Should You Use? Read More .

Visual tools give a great insight into just what is going on with your PC’s hard disk drive that a list of numbers simply cannot relate. One of the most popular options for this on Windows is WinDirStat Visualize your Hard Drive Usage with WinDirStat Visualize your Hard Drive Usage with WinDirStat Read More , which is a clone of the KDirStat utility, upon which QDirStat is based.

With QDirStat, your HDD usage is represented by rectangles and squares, each of a different size. The bigger the square, the more HDD space is being used by that particular directory. Right-clicking on the rectangle in question will give you the option to visit the folder location.

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools qdirstat

This is a great way to find “secret” data that has been downloaded to your computer. Things like missing download locations and your internet cache can all be traced with these tools. And if you don’t like the “blocky” view, usage data can also be viewed as a histogram.

You can get QDirStat via GitHub, but packages are available for openSUSE, SLE, and Ubuntu.

For the latter, first add the PPA (remember to remove it later):

sudo add-apt-repository ppa:nathan-renniewaldock/qdirstat

sudo apt-get update

Once this is done, install with

sudo apt install qdirstat

You can then launch the software from the desktop, or from the terminal with the qdirstat command. Follow the prompt to select the directory to scan, then wait until the data is collated and presented.

A KDE version, K4DirStat, is also available.

4. Disk Usage Analyzer (aka Baobab)

Formerly known as Baobab, Disk Usage Analyzer is, as you might have guessed, another visual tool. Rather than the block-based approach of QDirStat, this utility offers a radial treemap pie chart as a live illustration of disk usage. You’ll find this in the right-hand pane; on the left, a list of the contents of the currently selected directory.

7 Great Apps to View Disk Usage in Linux linux disk analyzers baobab

Everything is color-coded for easy analysis, but Disk Usage Analyzer doesn’t really offer much more than that. For instance, there’s no easy shortcut to the directories you’re viewing, other than to open them manually in your default file manager Thunar vs. Nautilus: Two Lightweight File Managers For Linux Thunar vs. Nautilus: Two Lightweight File Managers For Linux Is Thunar a better file manager than Gnome's default, Nautilus? Read More .

Having said that, Disk Usage Analyzer is easy to use and ideal for quick checks of usage without too much involvement.

5. xdiskusage

Another block-based graphical usage analyzer, xdiskusage has a quite basic UI and gathers information from the du command. This is run on your behalf, however, so the usage data is quickly compiled and presented.

Install in Debian-based systems with

sudo apt install xdiskusage

Run the xdiskusage command in the terminal to launch, then select the directory, or disk, to analyze.

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools xdiskusage

The result is a tree-based presentation, with the parent directory block displayed left-most and the child directories and folders branching off to the right. Each block displays the directory name and disk usage.

You can navigate through this graphic representation of your directory structure using the mouse or arrow keys. Need to find out more about the directory block? Simply right-click for options, which include copying the path to the clipboard, and printing the display.

While it doesn’t offer great graphics, xdiskusage is designed to be extremely lightweight. If you’re in a situation where your disk has filled up without explanation and you’re short of space, xdiskusage could be the solution you’re looking for.

The downloadable executable for xdiskusage is 64-bit only, however the source can also be downloaded, and compiled on your system for installation.

6. Duc

Another disk usage tool employing the radial treemap approach is Duc. Featuring a collection of tools, you can install Duc on Debian-based distros with

sudo apt install duc

For other Linux families, you can download the source from the website and compile it How to Compile & Install TAR GZ & TAR BZ2 Files in Ubuntu Linux How to Compile & Install TAR GZ & TAR BZ2 Files in Ubuntu Linux Read More .

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools duc

Get started with Duc by indexing the /usr directory. This builds a database (more on that below), and can take a while on the first run:

duc index /usr

From here, you can use ls to list the contents of the directory and their impact on the HDD:

duc ls -Fg /usr/local

If you prefer to see this in Duc’s visual analyzer meanwhile, use

duc gui /usr

7 Great Apps to View Disk Usage in Linux muo linux diskusagetools duc gui

There’s also a console interface you can open with

duc ui /usr

Duc offers a far faster approach to disk usage analysis by maintaining a database of the disk’s contents. This makes it ideal for larger systems; the Duc website boasts that it has been tested with “500 million files and several petabytes of storage.”

7. JDiskReport

Another option for a lightweight installation is JDiskReport, which is a Java-based disk analysis tool. Because it’s Java, JDiskReport is cross-platform, which means you shouldn’t run into any issues running it on older or unusual Linux distributions.

7 Great Apps to View Disk Usage in Linux linux disk analyzers jdiskreport

After analyzing your HDDs, JDiskReport presents the statistical data as charts and tables. This is where it comes into its own — not only do you get the expected pie chart display, the utility also displays a top 50 list of the largest files. You’ll also find a screen displaying the largest files by type.

Java isn’t the most popular platform, and is a pain to update, but if you’re looking for something with better reporting options than xdiskusage, JDiskReport is the answer.

7 Disk Usage Tools for Linux: Which Is Your Favorite?

It doesn’t matter if you want to use native command line tools, awesome GUI visualizers or console-based analysis of your HDD usage: there’s a tool for everyone!

But which one do you use? Are you using a Linux disk usage tool that we haven’t covered? Tell us more in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Terry
    September 6, 2017 at 9:21 pm

    GDMap AKA Graphical Disk Map. It looks kind of similar to QDirStat but it is already in my distros repository.

  2. Jonathan
    August 27, 2017 at 3:43 pm

    Hi,
    I never used others disks analyser programs except Baobab and du before this article.
    Thank you for this article, it could be useful !

  3. Jason Leschnik
    February 6, 2016 at 6:50 am

    Check out ncdu

  4. George
    February 6, 2016 at 3:54 am

    ncdu is a console based one which is awesome.

    https://dev.yorhel.nl/ncdu

    in Debian you can install with apt:

    apt-get install ncdu -s

  5. Stefan Hundhammer
    December 30, 2015 at 10:44 pm

    KDirStat (and the work-in-progress QDirStat) also come with a script called perl-cache-writer that can scan filesystems on a server (if you want to, over night in a cron job). You can load the resulting file in the GUI to inspect what is eating up your disk space.

  6. PatrickEB
    November 28, 2015 at 3:20 am

    Thanks :)

  7. Howie
    May 5, 2015 at 5:28 pm

    Most importantly, xdiskusage lets you feed it the output from du, including output you captured from some other server. You can use it to browse the data for a headless server with no additional software on the server.

  8. Informático de Guardia
    March 15, 2009 at 8:27 am

    I love the Java app jDiskReport.

    Official Website

  9. None
    February 10, 2009 at 6:24 am

    http://gt5.sourceforge.net/ , nice for the remote server without a graphical user interface

  10. lolovroom
    February 10, 2009 at 1:19 am

    hi,

    you may also have talked about the du command line which is i guess the root of all those nice programs.
    Sometime to have a very quick overview, this is still the best method ;)

  11. zilvis
    February 10, 2009 at 6:14 am

    dev.yorhel.nl/ncdu/