The gzip application is a common compression format in the GNU/Linux platform. The gzip, gunzip, and zcat programs all handle gzip compression. These utilities only compress/decompress a single file or data stream. They cannot archive directories and multiple files directly. Fortunately, gzip can be used with both tar and cpio.
Compressing data with gzip
How to do it...
gzip will compress a file and gunzip will decompress it back to the original:
- Compress a file with gzip:
$ gzip filename $ ls filename.gz
- Extract a gzip compressed file:
$ gunzip filename.gz $ ls filename
- In order to list the properties of a compressed file, use the following command:
$ gzip -l test.txt.gz compressed uncompressed...