2012-11-19

Dump average file size within a directory

I had to provide some stats about feed files and found below time saving command here http://vivekjain10.blogspot.com/2008/02/average-file-size-within-directory.html

1:  find /some/dir -type f -name *.txt \  
2:  -print0 | xargs -0 ls -l | gawk \  
3:  '{sum += $5; n++;} END {print "Total Size: " sum/1024/1024 " MB : Avg Size: " sum/n/1024 " KB : Total Files: " n ;}'  
4:    
5:  Total Size: 55214.8 MB : Avg Size: 9792.17 KB : Total Files: 5774   

1 comment:

  1. If you're attempting to lose pounds then you have to start following this brand new custom keto plan.

    To create this keto diet service, certified nutritionists, fitness couches, and professional chefs united to develop keto meal plans that are productive, suitable, money-efficient, and satisfying.

    From their launch in January 2019, 1000's of individuals have already transformed their body and well-being with the benefits a certified keto plan can give.

    Speaking of benefits: in this link, you'll discover 8 scientifically-proven ones given by the keto plan.

    ReplyDelete