I often use
du --max-depth=n -h | sort --human-numeric-sort
Now I want to use tree, in a similar manner.
I found here a partial answer
tree -sh --sort=size --du
where --du makes tree reporting the cumulative size for each directory (as du).
This reports each file as well.
If I want to report only directories, I should add -d to tree.
But -d seems to do two things:
- Remove files from the report.
- Remove the size of files from the cumulative total computed for each dir.
Of course, I want only 1, not 2 (as du does).
So
tree -sh --sort=size --du -d
would always report "small" sizes, without considering file sizes.
Can tree overcome this? Is there any alternative?