Batch file question - average size of file in directory

Giorgos Keramidas keramida at ceid.upatras.gr
Wed Jan 3 11:24:06 PST 2007


On 2007-01-03 10:28, Kurt Buff <kurt.buff at gmail.com> wrote:
> I put together this one-liner after perusing 'man zcat':
> 
> find /local/amavis/virusmails -name "*.gz" -print | xargs zcat -l >> out.txt
> 
> It puts out multiple instances of stuff like this:
> 
> compressed  uncompr. ratio uncompressed_name
>     1508      3470  57.0% stuff-7f+BIOFX1-qX
>     1660      3576  54.0% stuff-bsFK-yGcWyCm
>     9113     17065  46.7% stuff-os1MKlKGu8ky
> ...
> ...
> ...
> 10214796  17845081  42.7% (totals)
> compressed  uncompr. ratio uncompressed_name
>     7790     14732  47.2% stuff-Z3UO7-uvMANd
>     1806      3705  51.7% stuff-9ADk-DSBFQGQ
>     9020     16638  45.8% stuff-Caqfgao-Tc5F
>     7508     14361  47.8% stuff-kVUWa8ua4zxc
> 
> I'm thinking that piping the output like so:
> 
> find /local/amavis/virusmails -name "*.gz" -print | xargs zcat -l |
> grep -v compress | grep-v totals
> 
> will do to suppress extraneous header/footer info

Sure.  This is also better than grabbing the second column
unconditionally, which I suggested before :)


More information about the freebsd-questions mailing list