Hi,
I am using CentOS to run a web server, but I believe that this is a simple newbie question so I hope that I am posting this in the correct forum.
I have a number of users with files owned by the user "nobody" in their home directories. Would someone be able to help me with the following please?
1. How would I go about finding the user's that have files in their home directories that are owned by "nobody"? I know that I can do
Code:
#find /home -user "nobody"
however, I would like to have a
summary of the locations where these files are, rather than a verbose listing of every file. Is this possible?
2. A long time ago, I was given a command to scan a user's home directory and calculate the disk usage of their "nobody" files:
Code:
#find /home/directory -user nobody | xargs -i du -b "{}" | awk '{sum+=$1} END {print sum/1024/1024" MB"}'
However, when I run this command on an example user, it doesn't show the true disk usage of the files owned by the "nobody" user. Furthermore, if I use the same command to find files owned by the example user, it comes back with 6GB, which is not correct either as they have a quota of 800MB. So clearly something isn't right with that command.
Any help would be appreciated. Thank you.