1

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?

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151

1 Answers1

1

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.
Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151