I really like to use xdiskusage on Ubuntu. It shows the disk usage of my files and folders in a handy way.

I've got Raspbmc installed on my Raspberry Pi, which doesn't have a X server. Thus, I cannot use xdiskusage on it. Is there any good CLI alternative to it?


The du (diskusage) command is what you want.

du / Will show you the usage of every directory measured in blocks.

du --max-depth=1 -k / Will show the usage for the top level directories measured in Kb.

My favorite usage is: du --max-depth=1 / |sort -n

By piping the output to sort -n it will sort the list from least use to most.

Replace / in the examples with the top level directory you want to check.


I found a way to do this: ncdu.

SSH into the Raspberry Pi, then run the command ncdu / . This will show the disk usage in a xdiskusage way. You can navigate with your keyboard just like in xdiskusage.

By the way, I found that it's still possible to use xdiskusage without an X server on the Pi: ssh pi@<IP> 'cd /; du -k' | xdiskusage

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.