Search notes:

Linux shell command: gzip

gzip compresses files so that their file size is smaller. Compressed files have the file suffix .gz.
Usually, a set of files is first packed into a tar archive (with the file suffix .tar) and the gzip'ed, resulting in a file with the suffix .tar.gz (sometimes, tgz is seen instead).
The alternative zip utility does both in one step: it packages files and compresses them.
gzip uses the Lempel-Ziv (LZ77) coding.
Supported compression methods:
With --name, the uncompressed name, date and time are those stored within the compress file if present. With --verbose, the size totals and compression ratio for all files is also displayed, unless some sizes are unknown. With --quiet, the title and totals lines are not displayed.

Command line options

-a --ascii Convert end of lines using local conventions, supported on non-Unix systems. In Windows environmment, CR LF is converted to LF when compressing, and LF is converted to CR LF when decompressing.
-c --stdout, --to-stdout Output to stdout.
-d --decompress, --uncompress Decompress
-f --force
-h --help
-l --list When compressing: print compressed size, compression ratio and name of the uncompressed file. With --verbose, it also prints comppression method, crc, time stamp of uncompressed data.
-L --license Display the gzip license and quit.
-n --no-name When compressing, do not save the original file name and time stamp by default. When decompressing, do not restore the original file name and time stamp. Default option when decompressing.
-N --name When compressing, also store the original file name and time stamp. When decompressing, restore the original file name and time stamp (if present). Default option when compressing.
-q --quiet Suppress all warnings.
-r --recursive
-S --suffix Add specified suffix instead of .gz. when compressing. .z and .gz (?) should be avoided to avoid confusion when files are transferred to other systems.
-t --test Check the compressed file integrity.
-v --verbose Display the name and percentage reduction for each file compressed or decompressed.
-V --version Display the version number and compilation options then quit.
-# --fast, --best # = 1…9 (1 = fastests, 9 = best), defualt = -6

See also

In Oracle, a byte stream that is compatible to gzip -n can be produced with utl_compress.
Shell commands
zip, zcat

Index