Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jan 2007 21:23:27 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Kurt Buff <kurt.buff@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Batch file question - average size of file in directory
Message-ID:  <20070103192326.GA7371@kobe.laptop>
In-Reply-To: <a9f4a3860701031028w2af80416k20f7abf46eaa9a81@mail.gmail.com>
References:  <a9f4a3860701021020g1468af4ah26c8a5fe90610719@mail.gmail.com> <20070103013416.GA1161@kobe.laptop> <a9f4a3860701031028w2af80416k20f7abf46eaa9a81@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2007-01-03 10:28, Kurt Buff <kurt.buff@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 :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070103192326.GA7371>