How to find the top 6 users (which consume most space)?

Hi everybody,

I want to know if there is any posibility to find out - on an AIX system - which are the the users who consume most space or at least a posibility to obtain a list with all the users and how much space are they consuming ?

Trying to use du command was useless. Any idea? :confused:

Thanks!

The du command should do it... Try this:
"du -s /home/* | sort -rn | head -6"

Thank you! The command works indeed, but I need to find out how much space consumes each of the top 6 users from another directory, not their own space from /home.
The AIX machine we are talking about is shared between more users. Each of them has his own working directory (/home/userid), but here there is no problem because this quota is limited.
Besides this space, the users have also access in another directory(ies) where they create some "views" which consume the available disk space. I need to find out the users who consume the most of it.
The list of the users can be "loaded" from /home directories list.

make a find / -type f -exec ls -l {} \;

save to a file, grep for every user in a loop and add the file sizes

sort for size

done

for user in user1 user2 user3 user4 user5 user5 user6
do
total=`find / -user ${user} -exec ls -l {} \;| awk '{print x+=$5/1024}' | tail -1`
echo "${user} used ${total} KBs on system `uname -n` "
done

# That should give you everything that you wanted. I have only access to an hpux system at the moment, please check if 5th column is size on a aix system ( ls -l )

Regards,

Kaps

du -k /var | sort -rn | more

Just replace /var with whatever directory you looking for.