Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

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.
share|improve this answer
Thank you - missed this somehow. – depesz Dec 15 '09 at 16:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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