NetBSD/distrib/utils/x_gzip/gzip.1

154 lines
4.1 KiB
Groff

.\" $NetBSD: gzip.1,v 1.1.1.1 1998/06/06 06:11:19 mrg Exp $
.\"
.\" Copyright (c) 1997 Matthew R. Green
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd January 21, 1997
.Dt GZIP 1
.Os
.Sh NAME
.Nm gzip
.Nd compression/decompression tool using Lempel-Ziv coding (LZ77)
.Sh SYNOPSIS
.Nm
.Op Fl cdfhqrtvV
.Op Fl S Ar suffix
.Ar file
.Oo
.Ar file Oo ...
.Oc
.Oc
.Nm gunzip
.Op Fl cfhqrtvV
.Op Fl S Ar suffix
.Ar file
.Oo
.Ar file Oo ...
.Oc
.Oc
.Nm zcat
.Op Fl fhV
.Ar file
.Oo
.Ar file Oo ...
.Oc
.Oc
.Sh DESCRIPTION
The
.Nm
program compresses and decompresses files using Lempel-Ziv coding (LZ77).
If no
.Ar files
are specified,
.Nm
will compress from standard input, or decompress to standard output.
When in compression mode, each
.Ar file
will be replaced with another file with the suffix, set by the
.Fl S Ar suffix
option, added, if possible.
In decompression mode, each
.Ar file
will be checked for existance, as will the file with the suffix added.
.Pp
If invoked as
.Nm gunzip
then the
.Fl d
option is enabled. If invoked as
.Nm zcat
or
.Nm gzcat
then both the
.Fl d
and
.Fl c
options are enabled.
.Sh OPTIONS
The following options are available:
.Bl -tag -width Sxxxsuffix
.It Fl c
Thi option specifies that output will go to the standard output stream,
leaving files intact.
.It Fl d
This option selects decompression rather than compression.
.It Fl f
This option turns on force mode. This allows files with multiple links,
overwriting of pre-existing files, reading from or writing to a terminal,
and when combined with the
.Fl c
option, allowing non-compressed data to pass through unchanged.
.It Fl h
This option prints a usage summary and exits.
.It Fl q
With this option, no warnings or errors are printed.
.It Fl r
This option is used to
.Nm
the files in a directory tree individually, using the
.Xr fts 3
library.
.It Fl S Ar suffix
This option changes the default suffix from .gz to
.Ar suffix .
.It Fl t
This option will test compressed files for integrity.
.It Fl v
This option turns on verbose mode, which prints the compression ratio
for each files compressed.
.It Fl V
This option prints the version of the
.Nm
program.
.It Fl 1
.It Fl 2
.It Fl 3
.It Fl 4
.It Fl 5
.It Fl 6
.It Fl 7
.It Fl 8
.It Fl 9
These options change the compression level used, with the
.Fl 1
option being the fastest, with less compression, and the
.Fl 9
option being the slowest, with optimal compression.
.El
.Sh HISTORY
The
.Nm
program was originally written by Jean-loup Gailly, licensed under the GNU Public
Licence. Matthew R. Green wrote this front-end for the freely
distribution zlib compression library, for
.Nx 1.3 .
.Sh BUGS
The
.Nm
program does not print the compression ratio when not using files.
.Sh SEE ALSO
.Xr fts 3 .