O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

gzip — stdin  stdout  - file  -- opt  --help  --version

Synopsis

gzip [options] [files]

gzip and gunzip compress and uncompress files in GNU Zip format. Compressed files have the suffix .gz.

Sample commands

gzip file

Compress file to create file.gz. Original file is deleted.

gzip -c file

Produce compressed data on standard output.

cat file | gzip

Produce compressed data from a pipeline.

gunzip file.gz

Uncompress file.gz to create file. Original file.gz is deleted.

gunzip -c file.gz

Uncompress the data on standard output.

cat file.gz | gunzip

Uncompress the data from a pipeline.

zcat file.gz

Uncompress the data on standard output.

gzipped tar files: sample commands

tar -czf myfile.tar.gz dirname

Pack directory dirname.

tar -tzf myfile.tar.gz

List contents.

tar -xzf myfile.tar.gz

Unpack.

Add the -v option to tar to print filenames as they are processed.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required