Take the 2-minute tour ×
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
add comment

1 Answer

up vote 1 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. –  user13185 Dec 15 '09 at 16:14
add comment

Your Answer

 
discard

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