The Gzip Basics

Gzip is data compression software used to compress a file into an archive, as well as expand an already-compressed archive back into a file. One common use for gzip is to compress a tarball.

[One could use Zip both to collapse and compress a directory, instead of tar / gzip, but the compression isn’t as good; the resulting “.zip” file would be larger than the equivalent “.tar.gz” file.]

I need to compress a file:

gzip [filename]

The resulting, compressed file will replace the source file and have a “.gz” suffix, like so:

[filename].gz

I need to expand a compressed file:

gunzip [filename].gz