LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux User and partition size used by him (https://www.linuxquestions.org/questions/linux-newbie-8/linux-user-and-partition-size-used-by-him-941838/)

Pchinmay 04-26-2012 07:15 AM

Linux User and partition size used by him
 
Hi,

I am trying to get particular Users partition details in following format,

Example,

Partition path : /home/abc
Now on this partition wants partition usage as,

User - Total partion size Used by him - All partition occupied paths for files/folder


User1 - 1Gb - /home/abc/testA
/home/abc/testA
User2 - 500Mb - /home/abc/testB
/home/abc/testB
User3 - 144Kb - /home/abc/testC
/home/abc/testC

I tried (find /home/abc/ -printf "%u %h %s\n") this works to some extent but it doesn't provide total calculated partition size and there is repetition of user name.

Can anyone help me in this to achieve this.

Appreciate any help.

Thanks!

jschiwal 04-26-2012 07:37 AM

Does each user have their own partition, or do you want to know each user's disk space?

du -s /home/abc/*

Pchinmay 04-26-2012 11:14 PM

Linux User and partition size used by him
 
No each user doesnt have seperate partition in this case. Here each one of them have created multiple directries on abc (/home/abc) project partition. and yes, i need to find out users disk space on this partition along with path details.

du -h /home/abc/* does provide each paths partition disk usage but doesnt support any switch for author.

Is ther any way to get this with the help of "awk" command or any linux cammand with supportitng switches?

Thanks!


All times are GMT -5. The time now is 01:32 PM.