May 2017
Beginner
552 pages
28h 47m
English
gzip will compress a file and gunzip will decompress it back to the original:
$ gzip filename
$ ls
filename.gz
$ gunzip filename.gz
$ ls
filename
$ gzip -l test.txt.gz
compressed uncompressed ratio uncompressed_name
35 6 -33.3% test.txt
Read data from stdin and output the compressed data to stdout:
$ cat file | gzip -c > file.gz
The -c option is used to specify output to stdout.
The gzip -c option works well with cpio:
$ ls * | cpio -o | gzip -c > cpiooutput.gz
$ zcat cpiooutput.gz ...