.TH gunzip "" "" "Command"
.PC "GNU utility to uncompress files"
\fBgunzip [ \-cfhLrtvV ] [ \fIfile ... \fB]\fR
.PP
.HS
.SH Options:
.IC \fB\-c\fR
Write output to the standard output
.IC \fB\-f\fR
Force:
decompress a
.I file
even if its has multiple links or the corresponding file already exists
.IC \fB\-h\fR
Help:
display a screenful of information about how to use this command
.IC \fB\-L\fR
Display licensing information
.IC \fB\-r\fR
Recurse:
if a
.I file
is a directory,
attempt to uncompress all files within it
.IC \fB\-t\fR
Test the integrity of a compressed
.I file
.IC \fB\-v\fR
Give a verbose description of each action
.IC \fB\-V\fR
Print the current version of this command
.HE
.II GNU
.B gunzip
is the GNU command that uncompresses each
.I file
named on its command line.
.PP
Whenever possible,
.B gunzip
replaces each
.I file
whose name ends with
.B .z
or
.B .Z
(and which begins with the correct magic number) with an
uncompressed file without the original suffix.
.B gunzip
also recognizes the special extensions
.B .tgz
and
.B .taz
as
shorthands for
.B .tar.z
or
.BR .tar.Z .
.PP
.B gunzip
can currently decompress files created by the \*(CO commands
.B gzip
or
.BR compress ,
or by the \*(UN commands
.B zip
or
.BR pack .
It automatically detects the format by which the file is compressed
and applies the correct algorithm to uncompress it.
.PP
When uncompressing the formats used by
.B gzip
and
.BR zip ,
.B gunzip
checks a 32-bit CRC.
For files compressed by
.BR pack ,
.B gunzip
checks the uncompressed length.
.PP
The format used by
.B compress
was not designed to allow consistency checks.
However,
.B gunzip
can sometimes detect a corrupted
.B .Z
file.
If you get an error when uncompressing a
.B .Z
file, do not assume that the
.B .Z
file is correct simply because the \*(CO command
.B uncompress
does not complain.
This generally means that most implementations of
.B uncompress
do not check their input, and happily generate garbage output.
.SH "Command-Line Options"
.B gunzip
recognizes the following command-line options:
.IP \fB\-c\fR
Write output to standard output, and do not change the original
.IR file .
If the command line names more than one
.IR file ,
.B gzip
writes to the standard output
a sequence of independently compressed members.
To obtain better compression, concatenate the
.IR file s
before compressing them.
.IP \fB\-f\fR
force compression or decompression, even if
.I file
has multiple links or the corresponding file already exists.
Without this option, and when not running in the background,
.B gzip
prompts to verify whether it should overwrite an existing file.
.IP \fB\-h\fR
Help:
display a screenful of information on how to run this program.
.IP \fB\-L\fR
Display the
.B gzip
license.
.IP \fB-r\fR
Recurse:
if a
.I file
is a directory, compress or uncompress all files within it.
.IP \fB-t\fR
Test:
check the integrity of a compressed file.
.IP \fB\-v\fR
Verbose:
display the name and percentage reduction for each
.I file
as it is compressed.
.IP \fB-V\fR
Display the version of this command, and the options by which it
was compiled.
.SH "See Also"
.Xr "commands," commands
.Xr "compress," compress
.Xr "compression," compressi
.Xr "gzip," gzip
.Xr "unpack" unpack
.SH Diagnostics
.B gunzip
returns zero if all went well.
It returns one if an error occurred and it returns two if it
had to issue a warning message.
.PP
.B gunzip
can issue the following warning messages:
.IP "\fIfile\^\fB: not in gzip format\fR"
A
.I file
named on the command line was not compressed.
.IP \fIfile\^\fB: Corrupt input. Use zcat to recover some data.\fR"
The compressed file has been damaged.
If the data were compressed by the program
.BR compress ,
they can be recovered up to the point of damage by using the program
.B zcat
to concatenate the file into another file.
.IP "\fIfile\^\fB: compressed with \fIXX \fBbits, can only handle \fIYY \fBbits\fR"
.I file
was compressed by a program that could deal with more bits
than the decompress code on this machine.
Recompress the file with
.BR gzip ,
which compresses better and uses less memory.
.IP "\fIfile\^\fB: already has z suffix -- no change\fR"
.I file
has the suffix
.B .z
or
.BR .Z ;
therefore,
.B gunzip
assumes that it is compressed already.
.IP "\fIfile \fBalready exists; do you wish to overwrite (y or n)?\fR"
Respond `y' if you want the output file to be replaced; `n' if not.
.IP "\fBgunzip: corrupt input\fR
.B gunzip
detected a
.B SIGSEGV
violation, which usually means that the input file has been corrupted.
.SH Notes
.II "Free Software Foundation"
.II copyleft
.B gzip
is released under the conditions of the Free Software Foundation's
``copyleft''.
Full source code is available through the Mark Williams bulletin board.
