Blog → Post


(TIP) QDirStat
Visualizing your disk space
by @admin, may 10, 2021, 10:13am utc

WinDirStat is a nice tool on Windows for visually seeing what's-what on your hard drives ... as far as space goes.
Fortunately a very similar tool exists for Linux, called QDirStat (Qt Directory Statistics).
QDirStat lets you view your disk either as a folder tree, or as a graphical representation. Or both ways at once. You can resize the top or the bottom to cover the full window.


QDirStat, Split Screen

If you click on a folder such as /usr, as shown, all of the files in that folder are highlighted in a box on the visual portion as well. The folder will be outlined in red, just as /usr is in the first QDirStat image above

Click through the L1, L2 & L3 layout buttons at the top to see varying levels of detail of any file displayed in the top textual representation.

Individual files are color coded in the visual view, for easier identification.

• PDFs and EPUBs (documents) are dark blue,
• MP4s and MKVs (videos) are light green,
• ZIP (compressed) files are dark green,
• music is yellow, images are light blue, and so on.
• Most importantly, junk files such as .BAK files, are light red.

You can change the assigned colors, if desired, under the Settings menu.

You can click on any file and have its detail shown; or open file manager or the terminal to that spot; or even delete the file altogether. This is really a very nice way to quickly find the folders and files that are chewing up the most space on your disk.

A useful menu item here is Up One Level, which then selects the whole folder that a file was in. It is really very easy to negotiate around the drive using QDirStat's controls.



QDirStat, 100% Visual

Tip: When you start qdirstat from the command line, you can feed it the desired folder to start with.

e.g. from a command line in the terminal, the following line will: Start qdirstat right on the /var/www folder; separate qdirstat from the terminal (& disown), otherwise, closing the terminal would also close qdirstat. The final piece (&& exit) adds ( && ) the exit command to close the terminal. qdirstat will be left running.

$ qdirstat /var/www & disown && exit

Similar Tools
GDMap (Graphical Disk Map) is similar to QDirStat but has far fewer features and detail. Critically, files can not be deleted using GDMap's interface.

K4DirStat, another similar tool, is functionally the same as QDirStat.

But on Debian, unless you are using the KDE desktop, installing the KDE K4DirStat tool will want to bring along ... a lot ... of extras.

(a lot:)

# sudo apt-get install k4dirstat Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: kio libhfstospell10 libkf5attica5 libkf5completion-data libkf5completion5 libkf5doctools5 libkf5globalaccel-bin libkf5globalaccel-data libkf5globalaccel5 libkf5globalaccelprivate5 libkf5jobwidgets-data libkf5jobwidgets5 libkf5kiocore5 libkf5kiontlm5 libkf5kiowidgets5 libkf5solid5 libkf5solid5-data libkf5sonnet5-data libkf5sonnetcore5 libkf5sonnetui5 libkf5textwidgets-data libkf5textwidgets5 libkf5xmlgui-bin libkf5xmlgui-data libkf5xmlgui5 libqt5script5 libvoikko1 sonnet-plugins Suggested packages: voikko-fi hspell The following NEW packages will be installed: k4dirstat kio libhfstospell10 libkf5attica5 libkf5completion-data libkf5completion5 libkf5doctools5 libkf5globalaccel-bin libkf5globalaccel-data libkf5globalaccel5 libkf5globalaccelprivate5 libkf5jobwidgets-data libkf5jobwidgets5 libkf5kiocore5 libkf5kiontlm5 libkf5kiowidgets5 libkf5solid5 libkf5solid5-data libkf5sonnet5-data libkf5sonnetcore5 libkf5sonnetui5 libkf5textwidgets-data libkf5textwidgets5 libkf5xmlgui-bin libkf5xmlgui-data libkf5xmlgui5 libqt5script5 libvoikko1 sonnet-plugins 0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded. Need to get 6,430 kB/7,169 kB of archives. After this operation, 38.0 MB of additional disk space will be used. Do you want to continue? [Y/n]

That said, you'll want to consider k4dirstat if you are already running KDE.

tags: All users, Tips
Footer done in Inkscape