splitting

Splitting gzipped logfiles without storing the ungzipped splits on disk.

I have a recurring task of splitting a set of large (about 1-2 GiB each) gzipped Apache logfiles into several parts (say chunks of 500K lines). The final files should be gzipped again to limit the disk usage. On Linux I would normally do: zcat biglogfile.gz | split -l500000 The resulting files files will be named xaa, xab, xac, etc ...