linuxstatisticscommand-line-interfacediskdu

Directory Stats command line interface?


Windirstat/ Kdirstat/ Disk Inventory X has been nothing short of revolutionary in file managment. Why is there no text-only command line equivalent? I'd need it for SSH administration of my file servers.

We have all the building blocks: du, tree etc.

Is there one? Why not? Can someone please write one? :)

EDIT: du does ALMOST what I want. What I want is something that sorts each subdirectory by size (rather than full path) and indents so that it's easier to avoid double-counting. du would give me this:

cd a
du . -h

1G  b
2G  c
1K  c/d
1K  c/e
2G  c/f

It's not immediately obvious that c and c/f are overlapping. What I want is this:

cd a
dir_stats .

1G  b
2G  c
    |
    +---- 2G  f
    |
    +---- 1K  d
    |
    +---- 1K  e

in which it is clear that the 2G from f is because of the 2G from c. I can find all the info not related to c more easily (i.e. by just scanning the first column).


Solution

  • Don't bother trying to do disk space management with ascii art visializations. Du follows Unix's elegant philosophy in all respects and so gives you sorting etc for free.

    Get comfortable with du and you'll have much more power in finding disk hogs remotely