With gzip you can do something like this:

gzip -c file1 > output.gz
gzip -c file2 >> output.gz
gzip -c file3 >> output.gz

and when you uncompress output.gz it will contain concatenated values of file1 file2 and file3.

Can the same be done reliably with bzip2? I can't find any mention of this in bzip2 docs, but maybe I'm just bad at reading/understanding?

link|improve this question

74% accept rate
feedback

1 Answer

up vote 2 down vote accepted

bzip2 apparently works the same way as gzip for that operation, even using the same -c option. From the bzip2 man page:

       bunzip2 will correctly decompress a file which is the concatenation  of
       two  or  more compressed files.  The result is the concatenation of the
       corresponding uncompressed files.  Integrity testing (-t)  of  concate‐
       nated compressed files is also supported.
link|improve this answer
Thank you - missed this somehow. – depesz Dec 15 '09 at 16:14
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.