I'm wondering if we can combine the honesty of 'du' with the indented formatting of 'tree'. If I want a listing of the sizes of directories:
du -hx -d2
...displays two levels deep and all the size summaries are honest, but there's no indenting of subdirs. On the other hand:
tree --du -shaC -L 2
...indents and colorizes nicely however the reported sizes are a lie. To get the real sizes one must:
tree --du -shaC
...which is to say that you only get the true sizes if you let 'tree' show you the entire directory structure. I'd like to be able to always have correct size summaries regardless of how many levels of subdirs I want to actually display. I often do this:
tree -du -shaC | grep "\[01;34m"
... which prunes out everything but directories, and indents them nicely ... but there's no easy way to limit the display to just a given number levels (without the summaries lying). Is there a way? Perhaps I've missed the correct switches ...