|
Advanced usage
Multiple compressed files can be concatenated. In this case,
This is an example of concatenating
gzip -c file1 > foo.gz gzip -c file2 >> foo.gz Then
gunzip -c foo is equivalent to
cat file1 file2 In case of damage to one member of a .gz file, other members can still be recovered (if the damaged member is removed). However, you can get better compression by compressing all members at once:
cat file1 file2 | gzip > foo.gz compresses better than
gzip -c file1 file2 > foo.gz If you want to recompress concatenated files to get better compression, do:
zcat old.gz | gzip > new.gz If a compressed file consists of several members, the uncompressed size and CRC reported by the --list option applies to the last member only. If you need the uncompressed size for all members, you can use:
zcat file.gz | wc -c
If you wish to create a single archive file with multiple members so
that members can later be extracted independently, use an archiver such
as
|