Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Total file size of a subset list Post 302177535 by tekster757 on Friday 21st of March 2008 11:19:21 AM
Old 03-21-2008
Total file size of a subset list

Thank you! Yes, that worked very well. But now I'm curious about a couple of things (i.e., please explain a little of how it works):

Instead of bothering you with even more questions than, I looked awk in google and found gnu.org and searched on +=. It gave me this:

ls -l files | awk '{ x += $5 }
END { print "total K-bytes: " (x + 1023)/1024 }'

1. Should I be using the (x + 1023)/1024 stated above (I'm wondering why they have that)?
2. I have GB of files, is there a different number I can use to get GB or do I just add 2 zero's?
3. Why %4.2f\n (what does that mean)?

Thanks!
 

10 More Discussions You Might Find Interesting

1. HP-UX

total size taken by directory

HI ALL, i am a beginner in unix world. can anyone please tell me the way to find total size taken by each directory (including size of all subdirectories and files) present under /var. e.g what is space occupied by /var/adm , /var/admin etc. its a simple question but still i dont know the... (2 Replies)
Discussion started by: jyoti
2 Replies

2. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

3. Shell Programming and Scripting

Getting the total file size for certain files per directory

Hi, I am trying to get the total file size for certain files per directory. I am using find /DirectoryPath -name '*.dta' -exec ls -l {} \; | awk '{ print $NF ": " $5 }' > /users/cergun/My\ Documents/dtafiles.txt but this lists all the files in the directories. I need the total... (9 Replies)
Discussion started by: cergun
9 Replies

4. Shell Programming and Scripting

total size

I have a directory that contains files like aaa-2010-05-30.txt ddd-2010-05-30.txt www-2010-05-30.txt i have total 2000 files, i need to calculate total size of files for *2010-05-30.txt like aaa-2010-05-30.txt 200MB ddd-2010-05-30.txt 10GB www-2010-05-30.txt 4GB Total 14.2 GB... (5 Replies)
Discussion started by: learnbash
5 Replies

5. UNIX for Dummies Questions & Answers

I am trying to get the total size of a folder?

I am trying to get the total size of the folder using the below command but its not working. any ideas? du -bc <foldername>/|grep total|tr -s " "|cut -d" " -f1 the output i am getting is 78996 total but i just want it to be as 78996 please help (3 Replies)
Discussion started by: classic
3 Replies

6. Linux

Increasing total data size per file system request for block drivers

Hi All, I am writing a block driver for a 2GB SD card where i get the total amount of data per request as follows: struct request *req; uint card_addr,total_bytes; struct request_queue *rq = BlkDev->queue; req = elv_next_request(rq); .. .. card_addr = req->sector*512;... (1 Reply)
Discussion started by: amio
1 Replies

7. Shell Programming and Scripting

Find a particular directory in multiple file systems and calculate total size

Hello : I need some help in writing a ksh script which will find a particular directory in all the file systems in a server and finally report the total size of the direcotry in all the file systems. Some thing like this.. find /u*/app/oracle -type d -name "product" -prune and then... (1 Reply)
Discussion started by: Sam1974
1 Replies

8. Solaris

Need command to know the total size

:mad:i need command to know the total size of project in my system by Giga bit i try #du -s /*/projectname but i need total size for this project by G.B can you help me (6 Replies)
Discussion started by: ayman
6 Replies

9. Shell Programming and Scripting

Total count in each category for given file list

I have list of file names in filename.txt below is file format >>File1 _________________________ 01~12345~Y~YES~aaaaa~can 02~23456~N~NO~bbbbb~can . . . 99~23__________________________ Need to find total count from each file depending on specific string and add them to have total count... (17 Replies)
Discussion started by: santoshdrkr
17 Replies

10. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies
cacheadm(1)							    ShapeTools							       cacheadm(1)

NAME
cacheadm - administer and configure AtFS derived object cache SYNOPSIS
cacheadm [-Amax_cached_per_cacheattr] [-Nmax_cached_per_name] [-Tmax_total_cached] [-q] [-v] directories DESCRIPTION
cacheadm provides control over the size of a derived object cache. You may set the maximum total number (T) of derived files to be stored, the maximum number of derived files per name (N) and the maximum number of derived files with the same name and the same caching attribute (A). Called without any options, cacheadm returns the actual sizes of the derived object caches in the named dirctories. An empty list of directories causes cacheadm to operate on the current directory. The relationship of the three cache size values must always be T >= N >= A. The caching attribute mechanism is described on the af_cache(3) manual page. When calculating your caching sizes you should keep in mind that you may set the total size (T) to any value but your cache will never grow bigger than N*number_of_names. Number_of_names is the number of source object histories in your directories, where derived objects may be compiled from. If you set T to an astronomic value, the cache adapt it's size to the number of source histories automati- cally. In the current implementation, the caching sizes can only be increased. Reduction of the maximum cache size is only possible when the cache is empty. Hence you have to clean your cache (atfsrepair -C (1)) first if you want to shrink its size. OPTIONS
-A max_cached_per_cacheattr Set the maximum number of derived files with the same name and the same caching attribute to be stored. Default is 1. -N max_cached_per_name Set the maximum number of derived files with the same name to be stored. Default is 3. -T max_total_cached Set the total maximum number of derived files to be stored in the derived object cache. Default is 64. -q Quiet operation. Sup- presses any output to stdout. This option does not affect error messages (stderr). -v Output version identification string. SEE ALSO
chgrp(1), chmod(1), atfsrepair(1), af_cache(3) AUTHOR
Andreas.Lampen@cs.tu-berlin.de AtFS-1.71 Thu Jan 13 15:30:55 1994 cacheadm(1)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy