π

Visualizing GNU/Linux Disk Usage with xdu

Show Sidebar

Update 2017-07-23: Screenshot and block-size

Now and then, everybody has to look out for folders on the hard drive which do consume unusual amount of space for a variety of reasons. A very handy tool I am using on GNU/Linux since many years is xdu. The tool is using the visualization technique called layered space-filling tree browser to quickly give you an overview of what (sub-) directories occupy what amount of disk space.

Window showing the xdu output of this blog
xdu output window of this blog

The usage in the command line is pretty easy:

du | xdu	  

If you want to get insight on the usage on a remote host, you can also use a temporary file:

du > 2014-03-25-hostname.du.log	  

On localhost, you can do the analysis with:

scp remoteuser@remotehost:2014-03-25-hostname.du.log .
xdu < 2014-03-25-hostname.du.log	  

The interface looks pretty simple and it is actually simple. It gets the job done. You can navigate through sub-trees by using your mouse and clicking on any directory.

If you've got a fairly large hard disk with lots of data, you might run into an issue where xdu gets an overflow. You can use a different unit such as Gigabytes with:

du --block-size=1G | xdu	  

Have fun.

By the way, on OS X I am using Disk Inventory X for the same reason. It's not that fast but more fancy than xdu. However, I seldom use any of those additional features.

Comment via email (persistent) or via Disqus (ephemeral) comments below: