1833995 Members
3960 Online
110063 Solutions
New Discussion

how to calculate size...

 
SOLVED
Go to solution
chindi
Respected Contributor

how to calculate size...

Hi guys,


i would like to calculate the size of only a list of sorted files.how do i do it..
i eman is there any single line command to do it...

for example;

-rw-r--r-- 1 fnsonlg fnsgr 1136640 Oct 29 16:45 depp.dmp_gd
-rw-r--r-- 1 root sys 46392 Oct 29 16:51 depp.dmp.gz
-rw-r--r-- 1 root sys 419887 Nov 4 16:50 glif.dmp.gz
-rwxrwxrwx 1 root sys 5468892 Nov 5 12:20 gldm.dmp.gz
-rw-rw-rw- 1 root sys 8048640 Nov 6 12:06 fnsonlt0.tar
-rw-r--r-- 1 fnsonlx fnsxr 7029314 Nov 24 10:29 stmt.dmp.gz
-rw-r--r-- 1 fnsonlx fnsxr 33290044 Nov 24 11:13 invm.dmp.gz
-rw-r--r-- 1 fnsonlx fnsxr 39165152 Nov 24 11:15 tds.dmp.gz
from the above list i must only get the size of ll *dmp* in kilobytes


3 REPLIES 3
Jean-Luc Oudart
Honored Contributor
Solution

Re: how to calculate size...

ll *dmp | awk '{sum+=$5;}END{print "sum kb", sum/1024;}'

regards
Jean-Luc
fiat lux
R.K. #
Honored Contributor

Re: how to calculate size...

You can use awk..

# ls -l | grep dmp* | awk '{print "Size of:", $9, ":" ,$5/1024, "Kb"}'
Don't fix what ain't broke
chindi
Respected Contributor

Re: how to calculate size...

thanx guys ....very much.