find size of folders and its subfolders with the Owner details

HI,

I have the following command that shows me the total size of folders and subfolders :

du -hs *| sort -n

result:

1.0M sandeep
1.4G sandy
1.4M important
1.6M files

but I will need to know the size of folders and its subfolders( not size of individual files though) with the Owner who created this folders and subfolders.

Can anyone help me please

Thanks,
Sandeep

Try du without the -s option.

Regards

This is listing me all folders and there respective sizes in the folder:

example:

760K folder1/tmp/data/com
764K folder1/tmp/data
12K folder1/abn/reddy

thanks, but how do i get the owner's name as well?

Do you know the users you will be needing this information for?

for u in alice bob charlie diana elmer; do
  echo === $u ===
  find . -type d -user $u | xargs du -sh
done

In theory, there's nothing to prevent alice from being the owner of a file in a folder which bob created, if the permissions allow this. In practice, of course, perhaps you can rule out or just ignore this.

There are n number of users on this server:(. But thanks for this , i really appreciate your help

Welp, how about

cut -d: -f1 /etc/passwd |
while read user; do
  echo === $u ===
  find . -type d -user $u | xargs du -sh
done