LS with du divided by ls wc-l sub directory average


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting LS with du divided by ls wc-l sub directory average
# 1  
Old 04-10-2008
LS with du divided by ls wc-l sub directory average

Hi.

I am trying to write a script that will create a list of directories with their total disk usage (including subdirectories) divided by the number of sub directories.

so i run an ls like this ls -d */images/*/, and that would give me my list. Then i want to get the du of every directory returned in that list, but divided by the number of subdirectories in it. Thereby giving me a subdirectory average of every directory in the output.

Thank you for any help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with average calculation.

i have a file with 2 columns. i want to calculate the average of column 1 based on the values of column 2. here's how the file looks like. i want to calculate the sums of numbers corresponding to 1 and then calculate the average. same for numbers corresponding to zero. any help with a code would... (1 Reply)
Discussion started by: onerokeyz
1 Replies

2. Shell Programming and Scripting

Bash to calculate average of all files in directory and output by part of filename

I am trying to use awk to calculate the average of all lines in $2 for every file in a directory. The below bash seems to do that, but I cannot figure out how to capture the string before the _ as the output file name and have it be tab-delimeted. Thank you :). Filenames in... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Shell Programming and Scripting

Average score

awk '{if(len==0){last=$4;total=$6;len=1;getline}if($4!=last){printf("%s\t%f\n", last, total/len);last=$4;total=$6;len=1}else{total+=$6;len+=1}}END{printf("%s\t%f\n", last, total/len)}' exon.txt > output.txt In the attached file I am just trying to group all the same names in column $4 and then... (2 Replies)
Discussion started by: cmccabe
2 Replies

4. Shell Programming and Scripting

Find the average and the different

Hi , Every day I'll get a file, in that I have to match today's file(20130619) third column to previous files (20130618,20130617), that is 124 present in previous files or not. If it matches then I have take the average values of 5th column of 124 from yesterdays and day before yesterdays file,... (5 Replies)
Discussion started by: Shenbaga.d
5 Replies

5. Shell Programming and Scripting

sum divided by count

Dear friends, I'm stuck with the task below, I would be thankful for all your replies. INPUT : Date Price Volume 20110601 73052811.61 2845833 20110602 61489062.96 9909230 20110603 72790724.65 1108927 20110606 48299507.20 7435881 20110607 ... (5 Replies)
Discussion started by: hernand
5 Replies

6. Shell Programming and Scripting

divided by 0 problem

Hi! i have a new shell script that will compute for a value... a = b/(b+c) c = d/(d+e) print b" "a" "d" "c but there will be an instance that either b+c or d+e will be "0".... if b+c or d+e is "0" it will print "#NA#... pls help me... thanks! (10 Replies)
Discussion started by: kingpeejay
10 Replies

7. Programming

calculate average

I have a file which is 2 3 4 5 6 6 so i am writing program in C to calculate mean.. #include<stdio.h> #include<string.h> #include <math.h> double CALL mean(int n , double x) main (int argc, char **argv) { char Buf,SEQ; int i; double result = 0; FILE *fp; (3 Replies)
Discussion started by: cdfd123
3 Replies

8. Shell Programming and Scripting

count average

Hi Friends, Can any one help me with count average of student marks in this file (i can not change structure of the input file): input file: 1:John Smith:2 3 4 5 2:Mark Anderson:3 2 3:Susan Waterman:2 4 2 (numbers of marks are different) output: Name:John Smith ID#: 1 Avg. mark:... (6 Replies)
Discussion started by: mleplawy
6 Replies

9. Shell Programming and Scripting

how to write divided function

hi iam facing problem for divided (%) arthemtic function in for condition. tell me reply and all the arthemtic function in one scripting . (2 Replies)
Discussion started by: naveeng.81
2 Replies

10. UNIX for Dummies Questions & Answers

average value

If I have a file like this, could anyone please guide me how to find the average value in each metrix. The file has got about 130,000 metrixs. Grid-ref= 142, 235 178 182 203 240 273 295 289 293 283 262 201 176 167 187 187 246 260 282 299 312 293 276 230 191 169 ... (2 Replies)
Discussion started by: su_in99
2 Replies
Login or Register to Ask a Question
list directory(1m)														list directory(1m)

NAME
list directory - Displays a list of all the directories whose names match the specified directory name SYNOPSIS
cdscp list directory directory-name [with attribute-name = attribute-value] ARGUMENTS
The full name of a specific directory. The last simple name can contain wildcard characters. The name of a particular attribute. The value of a particular attribute. DESCRIPTION
The list directory command displays a list of all the directories whose names match the specified directory name. The last simple name can contain wildcards. You can use a with attribute-name = attribute-value clause to limit output only to directories whose attributes have values equal to the specified values. A space must precede and follow the = (equals sign). Privilege Required You must have read permission to the parent directory. If you use a with attribute-name = attribute-value clause in the command, you also need read or test permission to the selected directories. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLE
The following command displays the names of all the directories in the /.:/sales directory: cdscp> list directory /.:/sales/* LIST DIRECTORY /.../abc.com/sales AT 1991-10-15-15:43:58 atlanta austin boston chicago ontario ny seattle RELATED INFORMATION
Commands: add directory(1m), create directory(1m), delete directory(1m), remove directory(1m), set directory(1m), set directory to skulk(1m), show directory(1m) list directory(1m)