any quicker way to list disc usage by users?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users any quicker way to list disc usage by users?
# 1  
Old 12-16-2010
Question any quicker way to list disc usage by users?

Hi:

it takes a long time for "du -sh list_of_users" to give you the output.

Is there a quicker way to get this info?


Thanks!

N.B. Phil
# 2  
Old 12-16-2010
du -sh list - I'm assuming list is a list of directories in someplace like /home where the username is the home directory.

du has to find the directory, then stat the files in the directory. It is doing this over and over for each "username" in the list.

One pass thru the whole directory tree is faster. Play around with this:
Code:
find /path/to/home  -exec ls -ls {} \ ; |
awk '{arr[$3]+=$1; next; }
       END {for (i in arr) {print i, arr[i]}  }'

This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 12-16-2010
Another method, I guess, would be to enable quotas on the filesystem you want to check. Then a running tally of each user's data usage is always available.
# 4  
Old 12-17-2010
Quote:
Originally Posted by jim mcnamara
Code:
find /path/to/home  -exec ls -ls {} \ ; |
awk '{arr[$3]+=$1; next; }
       END {for (i in arr) {print i, arr[i]}  }'

Thank you very much. I tried it but found the improvement is not very substantial.

when I time the du command, I found the (utime + stime)/real time is only 3%.

is there a way to make this ratio substantically higher?

Thanks.
# 5  
Old 12-17-2010
Faster disks. That's where the real slowdown is.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Usage by users

I would like to know how to capture the usage of CPU by each user. Is there a way to do this on AIX? Gaya (0 Replies)
Discussion started by: ggayathri
0 Replies

2. Shell Programming and Scripting

Usage of disc group to kick off Oracle RMAN backup

Hi guys, i need a small help. I was writing an automation script for import utility of oracle datapump. I am getting stuck in one part of the shell script where i am doing a grep on one of the filesystem and if it is above threshold then it would kick off an oracle RMAN backup. Fyi. i am grepping... (3 Replies)
Discussion started by: sub
3 Replies

3. UNIX for Advanced & Expert Users

Help in faster and quicker grepping

Hi, i have a log file of 8 GB size , i need to grep the count of a word which i give as an input , i mean to say to find the occurance of a word on that file. grep is taking too much time ,can you please give me any command so that i can grep the word in a quicker way.. thanks, ... (16 Replies)
Discussion started by: senkerth
16 Replies

4. Shell Programming and Scripting

Users and their storage usage

Hey, I'm trying to make a script that can list users and their storage usage in a file. Im trying to get it to where the format is: User xxkbs User2 xkb and so on. So far I figured out how to get the users, but I cannot figure out how to get the storage usage per user. This is what... (2 Replies)
Discussion started by: HakerDemon
2 Replies

5. UNIX for Dummies Questions & Answers

CPU usage restrictions for users?

I was wondering if there was a way to set resource usage per user. For example, if I use "grep -f <file1> <file2>" and the two files are very big it consumes a lot of resources. Onetime someone pinged me and asked what the hell I was doing and to kill it. Is there any way an SA can restrict... (7 Replies)
Discussion started by: MaindotC
7 Replies

6. AIX

balance CPU usage between users

Hi! Is there any way to balance CPU usage between users on percentage basis? Something like Resource Manager in Oracle databases. Regards. ---------- Post updated at 02:17 PM ---------- Previous update was at 02:09 PM ---------- Workload Manager? ---------- Post updated at 03:44 PM... (0 Replies)
Discussion started by: bas_ua
0 Replies

7. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

8. UNIX and Linux Applications

grant usage to users listed in a file

hi, i'm trying to grant usage to multiple users whose ids are in a file. i thought that i could put the mysql code within a while loop, but that's not working for me: while read user; do userid=$user passwd="changeme" query="grant usage on mysql.USERS.* to $userid... (2 Replies)
Discussion started by: ankimo
2 Replies

9. Solaris

Ultra 10 - Copying Files From Disc After Booting Up With Recovery Disc?

Hello, I'm still learning unix and I have what is probably a simple question but I can't seem to find the question to. I have an Ultra 10 Sparc Server running solaris 8 and the drive may have crashed (I hope not). Currently, it appears some files in the /etc folder are missing. I have a backup... (1 Reply)
Discussion started by: ideffects
1 Replies

10. UNIX for Dummies Questions & Answers

memory usage : kernel, oracle, other users

Hello, I'm looking for a command or script that could permit me to know what is memory usage group by HP-UX kernel, oracle processes and other users (specific software). A command like 'top' but for all processes and not only for 12 max could be very useful Thanks in advance (4 Replies)
Discussion started by: thierryUX
4 Replies
Login or Register to Ask a Question