Ubuntu: Check how space is distributed on a Linux system


I know how to check space left with:

df -h  

and I know to check the space of a folder with:

du -ch /path/to/folder/  

But let's say I have a 500 GB HardDisk and 350GB are used:

  • Wich is the best tool/command to get how the space is distributed ?

  • Should I do du -ch / ? (I think this is not optimal)

  • There is any special tool/app to do this ?

I'd like an app that stores how the space is distributed in my system, wich are the space occuped in each folder...

I'd like to have something like SpaceSniffer (You can check the windows tool here). It is a Windows program that examine your HardDisk and show in a easy & nice IU how the space is distributed on your computer

This kind of software is awesome for that day you check your HardDisk and it seems you've "lost" hundred of GB's and don't know where they are !


  • I've tried baobab and runs/works perfectly in my Ubuntu machine, I tested also JDiskReport, here I have to fix some issues but it works in Ubuntu & Windows

  • I assume JDiskReport will work in any  OS with Java installed, that's why I choose as correct answer. I've tried this in Ubuntu, Windows 8, Raspbian and CentOS and works in all of them (you have to install Java)

  • I have to say for those lovers of command-line your choice should be ncdu, it's awesome !!!

Baobab IU:

This is the baobab IU


Another very useful app for this is:


Is very similar to windows SpaceSniffer and has a very useful and intuitive IU.

You need Java to use it but it can run in every OS with Java

The user interface:

JDiskReport example in linux

Hope it helps !


One nice Gnome application is baobab. It comes with default ubuntu installation.

enter image description here

To get it,

sudo apt-get install baobab

apt-cache show baobab    Description-en: GNOME disk usage analyzer   Disk Usage Analyzer is a graphical, menu-driven application to analyse   disk usage in a GNOME environment. It can easily scan either the whole   filesystem tree, or a specific user-requested directory branch (local or   remote).   .   It also auto-detects in real-time any changes made to your home   directory as far as any mounted/unmounted device. Disk Usage Analyzer   also provides a full graphical treemap window for each selected folder.  



If you use the command line, you could use ncdu. It uses a command-line GUI (ncurses).


sudo apt-get install ncdu  


From its webpage:

[...] ncdu: A disk usage analyzer with an ncurses interface, aimed to be run on a remote server where you don't have an entire gaphical setup, but have to do with a simple SSH connection. ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.


Screenshot from the ncdu webpage


Check out the disk usage of your home directory:

ncdu ~  

You can enter subdirectories and delete files / whole folders from within the tool.


Use the ducks:

du -cks *|sort -rn|head -n11  

This will list the top ten subdirectories and files in the current path and the space they are using, and a total.

If you change the -cks to -cms it reports in MB's instead of KB's, which is probably more useful these days.

You can add x to the options on du to prevent it going into other file systems, if needbe.

(Credit: Linux Server Hacks, O'Reilly)


There is also kde application available on repository: Filelight

You can install it with sudo apt-get install filelight

NAME           filelight - Graphical disk-usage information    SYNOPSIS           filelight [Qt-options] [KDE-options] [path]    DESCRIPTION           Allows you to exactly understand exactly your disk usage by graphically         representating your filesystem as a set of concentric  segmented-rings.  

Screenshot:- screenshot


A bit late to collect a bounty, but the elephant in the room is missing!

gparted is the application of choice for me to show how disk space is distributed in the entire system.

Even for a Windows system prior to upgrading to Ubuntu, as seen below:

Screenshot of user prior to moving to Ubuntu


If you want to work with the installed tools, you could use du -sh /* which shows you the accumulated usage for each folder (and file) in / You can then do this for subfolders until you found what you are looking for. Of course, the tools mentioned in other answers are much nicer, but sometimes you can't easily install them.


Another option with simple and easy to understand interface:

  1. xdiskusage ( sudo apt-get install xdiskusage)

    After installing call it from terminal - xdiskusage

  2. KDirStat ( sudo apt-get install kdirstat)

This app is intended mainly for KDE.

  1. Gd map ( sudo apt-get install gdmap) The Gnome alternative to KdirsStat.

Also this link gives some more apps: http://www.makeuseof.com/tag/how-to-analyze-your-disk-usage-pattern-in-linux/

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »