On 5/30/24 18:54, Greg Wooledge wrote:
On Thu, May 30, 2024 at 06:51:30PM -0400, e...@gmx.us wrote:
It looks like "tree --du" should do it, but "tree -d --du -h" says

├── [452K]  Documents

when du says it's 787M.

Well, that sounds like one of the numbers includes subdirectories and
the other only includes files in the immediate directory.

From du(1):

       --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.

OK, now for "du -c".  From du(1):

       -c, --total
              produce a grand total

Well, that doesn't help much.

The question is: which one do you want?

I'd like the size of the entire tree, and I think that's what OP wants too.

I think "du -h -S -s Documents/" gives just the files in Documents, and not
its subdirectories, and it gives 269M.  "ls -ldh Documents/" says the
directory itsely takes up 36k, so I'm not sure where "tree" got that number.

Reply via email to