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


 
Thread Tools Search this Thread
Operating Systems AIX How to find the top 6 users (which consume most space)?
# 1  
Old 09-05-2007
Question 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? Smilie

Thanks!
# 2  
Old 09-05-2007
The du command should do it... Try this:
"du -s /home/* | sort -rn | head -6"
# 3  
Old 09-07-2007
Question Thank you, but...

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.
# 4  
Old 09-10-2007
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
# 5  
Old 09-17-2007
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
# 6  
Old 09-17-2007
du -k /var | sort -rn | more

Just replace /var with whatever directory you looking for.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Top 10 Users in mount level

Hi Members, I'm new to unix. Could you help me in solving my issue. My requirement is I need to pull Top 15 users in every mount. I could able to get the mount level information but I couldn't able to pull the top users in every mount. I see in every mount I could see a lot of nested... (3 Replies)
Discussion started by: UBEE
3 Replies

2. Shell Programming and Scripting

Space usage by top 5 users in a filesystem

I want to see top 5 users,who have occupied most amount of disk space in a filesystem. But not sure how to do it. I can get the usage for a particular user find . -user user -type f exec df -h {} \;|awk '{ s = s+$1 } END { print "Total used: ",s }' But how to get without specifying any user... (6 Replies)
Discussion started by: rka
6 Replies

3. Shell Programming and Scripting

Top utilization of the users through script

I am trying for a shell script like, if the ram utilization is less than 300M and the load average is more then 4.00 , should take all the top users of memory and CPU utilization through "top" and "ps " command and put under one path. (6 Replies)
Discussion started by: gsiva
6 Replies

4. Shell Programming and Scripting

How to consume all available space on partition?

Hi I'm doing some resilience testing and need to write a script to consume all of the available disk space on a partition and then to free it up again. This would need to be - Safe Dynamic, in that it calculates the free space prior to consuming it. I might want to go on to consume a... (7 Replies)
Discussion started by: bbq
7 Replies

5. Red Hat

Showing all users in 'users' and 'top' commands

Hi All, I work in a multi user environment where my school uses Red Hat Linux server. When I issue commands such as "top" or "users", I get to see what others are doing and what kinds of applications they are running (even ps -aux will give such information). "users" will let me know who else is... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. UNIX for Dummies Questions & Answers

how to find top 3 users currently logged on

For the first 3 users only that are currently logged in output their effective user id. thank you. (6 Replies)
Discussion started by: whyatepies
6 Replies

7. Shell Programming and Scripting

find top 4 users currently logged on can i use grep

For the first 4 users only that are currently logged in output their effective user id. It's not important the order in which each logged in i just want to have the top 4. Same question as here...... (0 Replies)
Discussion started by: whyatepies
0 Replies

8. Shell Programming and Scripting

top 10 users facebook.com

is it possible from shell utility that we can track top 10 ipaddress from squid access.log who visit facebook.com. cat /var1/log/squid/access.log | grep "192.168.1.13" | grep "facebook" | wc -l 777 above will find only one (2 Replies)
Discussion started by: learnbash
2 Replies

9. Shell Programming and Scripting

Script to check top 5 biggest disk space users

Hi all, I am needing a bash shell script to generate a list of the top 5 users using the most disk space. I am thinking that the du command would be used somehow but I am at a loss. Can anyone help? Thanks! (3 Replies)
Discussion started by: sytemx
3 Replies

10. UNIX for Dummies Questions & Answers

Swap space used greater than allocated using top

Hi there, When I run top on my machine it says I have 497M swap space in use, and 380M swap space free, but I have only allocated 512M swap space to the machine!!!! Does anyone know how swap used is calculated in the top command? Thanks... (1 Reply)
Discussion started by: chorgan
1 Replies
Login or Register to Ask a Question