4

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?

Exeleration-G
  • 293
  • 1
  • 3
  • 10

2 Answers2

3

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.

Craig
  • 3,014
  • 13
  • 15
2

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

Exeleration-G
  • 293
  • 1
  • 3
  • 10