On 07/13/2018 06:26 AM, davidson wrote:
On Fri, 13 Jul 2018, Richard Owlett wrote:

While pursuing a problem I found the tree command useful.
Not having used it recently I re-read the man page I got ideas related to a *TOTALLY UNRELATED* question.

For the second question it would be useful to have directory output in tree format showing the size on disk of that directory and all sub-directories under it.

Including regular files?

"Yes" and "No" <chuckle>
It was the "Implies -s." in the section you quoted that hinted that "tree -sd" might be what I wanted.
I just tried "--du". It prints the detail entry for each file.
I wish to print only directory level.

However the information I want is displayed - on a terminal it is colored blue. Unfortunately when saved to a file it is all "black on white". Perhaps piping it somewhere will allow me to parse it in a desired fashion.

Thank you.



from http://mama.indstate.edu/users/ice/tree/tree.1.html , in the
"FILE OPTIONS" section:

  | --du
  |   For each directory report its size as the accumulation of sizes
  |   of all its files and sub-directories (and their files, and so
  |   on). The total amount of used space is also given in the final
  |   report (like the 'du -c' command.) This option requires tree to
  |   read the entire directory tree before emitting it, see BUGS AND
  |   NOTES below. Implies -s.

(I don't have this program installed, and so I make no guarantees
regarding the helpfulness of this excerpt. I'm just browsing
documentation.)


"tree -sd" gives the visual shape desired.

Suggestions?

Good luck.

TIA








Reply via email to