.TH compression "" "" "Technical Information"
.PC "Programs used to compress text"
.PP
.I Compression
is the technique whereby a file is analyzed mathematically and made smaller.
Compress is very useful in reducing the amount of disk space taken up by
large files that you use infrequently.
.PP
The amount of compression will vary, depending upon the type of file being
compressed, the compression algorithm used, and the level of compression
requested.
In general, files that show a great deal of repetition internally will
compress more thoroughly than those that are largely random; thus, in
general a text file will compress more thoroughly than will a digitized
sound sample or image (although there are exceptions).
The higher the level of compression you request, the more thoroughly the
file will be compressed, but the longer the machine will have to work to
achieve it.
In most instances, raising the level of compression very high will save
only a few bytes at a great cost in computer time.
.PP
You should note, too, that although compression algorithms try very hard
not to lose information, it is possible that compressing some very complex
files may result in a loss of information:
that is, if you compress a file and de-compress it, the de-compressed file
may be exactly the same as it was before you first compressed it.
These programs will not affect most everyday varieties of data;
but you should be aware of this fact.
.PP
\*(CO comes with the following tools for compressing and uncompressing files:
.IP \fBcompress\fR
This program compresses files uses the Lempel-Ziv algorithm.
By default, it creates a file with the suffix \fB.Z\fR.
It replaces the uncompressed original with its compressed analogue.
.IP \fBgtar\fR
This program creates tape archives.
Its options \fB\-z\fR and \fB\-Z\fR invoke, respectively, the programs
.B gzip
and
.B compress
to compress the archive as it is being built, thus permitting you to build a
compressed archive automatically.
.IP \fBgunzip\fR
This de-compresses files that had been compressed by the program
.BR gzip .
By default, it works only with files that have the suffices \fB.z\fR
or \fB.gz\fR.
It replaces the compressed file with its uncompressed analogue.
.IP \fBgzip\fR
This program compresses files into the \fBzip\fR format.
In general, it is faster and more thorough than
.BR compress ,
although it may not work as well on some files.
It replaces the uncompressed original file with its compressed analogue.
.IP \fBuncompress\fR
This uncompresses files that had been compressed by
.BR compress .
It works with files that have the suffix \fB.Z\fR.
It replaces the compressed file with its uncompressed analogue.
.IP \fBzcat\fR
This program de-compresses ``on the fly'' programs that had been compressed
by
.BR compress ,
and writes the decompressed form to the standard output device.
This is useful if you want to look at the contents of a compressed file
but do not want to bother with de-compressing all of it.
.SH "Default Suffixes"
Compressed files cannot be used in their compressed form; you must first
uncompress them before you can use them.
The key to uncompressing a compressed file is figuring out what program it
was compressed with in the first place, so you can apply the correct
de-compression tool.
.PP
If you have received a compressed file from a third-party source, you may
have no idea what tool was used to compress the file; fortunately, however,
most compression tools use standard suffices to ``stamp'' the files they
compress.
The following table gives commonly used suffices, plus examples of how to
uncompress files that bear them:
.II .Z
.II .tar.z
.II .z
.II .tar.z
.II .tgz
.II .gtz
.II .taz
.DS
.ie n .ta 1.0i 2.75i 4.5i
.el   .ta 1.0i 3.5i 6.0i
	\fICompression	Decompression	Example\fR
\fISuffix	Program	Program\fR
\fB\&.Z\fR	\fBcompress\fR	\fBuncompress\fR	\fBuncompress foo.Z\fR
\fB\&.tar.Z\fR	\fBtar|compress\fR	\fBuncompress|tar\fR	\fBzcat foo.tar.Z | tar xvf -\fR
\fB\&.z\fR	\fBgzip\fR	\fBgunzip\fR	\fBgunzip foo.z\fR
\fB\&.tar.z\fR	\fBtar|gzip\fR	\fBgunzip|tar\fR	\fBgunzip foo.tar.z ; tar xvf foo.tar\fR
\fB\&.tgz\fR	\fBgtar \-cz\fR	\fBgtar \-xz\fR	\fBgtar \-xvzf foo.z\fR
\fB\&.gtz\fR	Same as \fB.tgz\fR
\fB\&.taz\fR	Same as \fB.tgz\fR
.DE
.SH "See Also"
.Xr "compress," compress
.Xr "gtar," gtar
.Xr "gunzip," gunzip
.Xr "gzip," gzip
.Xr "uncompress," uncompres
.Xr "Using COHERENT," using_coh
.Xr "zcat" zcat
