Sponsored Content
Top Forums Shell Programming and Scripting Users and their storage usage Post 302696941 by HakerDemon on Wednesday 5th of September 2012 10:25:38 PM
Old 09-05-2012
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 I have so far:
Code:
#!/bin/sh
# This script displays a user friendly message that lists the top 10 users of
# storage on the system in human readable form.

awk -F ":" '{ print $1}' /etc/passwd > usersAndStorage

#add storage usage part here and append to file using tabs

while read line
do 
	user=$(echo "$line" | cut -f1)
	#add usage here so it will show in terminal
	echo $user
	echo
done <$1

Thanks a lot to anyone who can help.

Last edited by Franklin52; 09-06-2012 at 04:19 AM.. Reason: Please use code tags for data and code samples
 

8 More Discussions You Might Find Interesting

1. AIX

AIX 4.3 storage usage report

hi, i'm new to this company and i'm using old AIX 4.3 with DAS and SSA storage. What is the best way to query a report for disk capacity, usage, free, etc. I know in AIX 5 there's a command for "du -g /" or "du -m /" to report the total usage but I'm not using AIX5. In AIX 4.3 I can use "df... (5 Replies)
Discussion started by: venerayan
5 Replies

2. 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

3. UNIX for Advanced & Expert Users

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 (4 Replies)
Discussion started by: phil518
4 Replies

4. 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

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. 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

7. 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

8. Shell Programming and Scripting

Storage usage over time

Hi every one, im kind new in scripting. i need to write a script that will collect my storage usage (df -k) like every hour and save the max amout and min amout into csv file so over time lest say one month we have the min/max values. Is it possible with awk command ? Any ideas are welcome.:) (4 Replies)
Discussion started by: venus699
4 Replies
CNFSSTAT(8)						    InterNetNews Documentation						       CNFSSTAT(8)

NAME
cnfsstat - Show usage of CNFS buffers SYNOPSIS
cnfsstat [-ahpPsv] [-c class] [-l [seconds]] [-m buffer] DESCRIPTION
cnfsstat reads pathetc/cycbuff.conf and pathetc/storage.conf to determine which CNFS buffers are available. It then reads the specified cyclic buffers and shows their usage status. cnfsstat can be invoked from rc.news if docnfsstat is set to true in inn.conf, and the result is written to syslog(3). OPTIONS
-a Besides its usual output, cnfsstat prints the age of the oldest article in the cycbuff. You may also want to use the -v flag to see extended consistency checks. -c class Only information for the specified class is printed. -h Print usage information and exit. -l [seconds] With this option, cnfsstat prints a status snapshot every seconds, and only exits if an error occurs. When unspecified, the default interval is 600 seconds. At each iteration, cnfsstat checks whether the cycbuff.conf and storage.conf files have been modified, and loads the new configuration if needed. -m buffer Print information about the specified buffer in a format suitable for MRTG. -p Print an MRTG config file. -P Write PID into pathrun/cnfsstat.pid. -s Write output to syslog(3) instead of standard output. -v Write additional information, especially about consistency checks for article storage and the history file. HISTORY
Written by Katsuhiro Kondou <kondou@nec.co.jp> for InterNetNews. Converted to POD by Julien Elie. $Id: cnfsstat.pod 9342 2011-08-16 14:00:13Z iulius $ SEE ALSO
cycbuff.conf(5), history(5), inn.conf(5), rc.news(8), storage.conf(5). INN 2.5.3 2011-08-22 CNFSSTAT(8)
All times are GMT -4. The time now is 09:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy