diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-06-22 22:17:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-06-22 22:17:47 +0000 |
commit | 0ee1753c09fbd023061c5538ab02b0a998957e74 (patch) | |
tree | f32f876dd9a07b8f3b191105694d2b75f8d2d44c /usr.bin/compress | |
parent | ecf6a47d9ebd0b763fbb923429e65f6ca9e5d3bd (diff) |
man page changes from jmc: use this as gzip too
Diffstat (limited to 'usr.bin/compress')
-rw-r--r-- | usr.bin/compress/compress.1 | 55 | ||||
-rw-r--r-- | usr.bin/compress/main.c | 6 |
2 files changed, 47 insertions, 14 deletions
diff --git a/usr.bin/compress/compress.1 b/usr.bin/compress/compress.1 index 285ff8f78c0..4bc390956c4 100644 --- a/usr.bin/compress/compress.1 +++ b/usr.bin/compress/compress.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: compress.1,v 1.17 2003/06/10 09:12:09 jmc Exp $ +.\" $OpenBSD: compress.1,v 1.18 2003/06/22 22:17:46 deraadt Exp $ .\" $NetBSD: compress.1,v 1.5 1995/03/26 09:44:34 glass Exp $ .\" .\" Copyright (c) 1986, 1990, 1993 @@ -39,7 +39,9 @@ .Os .Sh NAME .Nm compress , -.Nm uncompress +.Nm uncompress , +.Nm gzip , +.Nm gunzip .Nd compress and expand data .Sh SYNOPSIS .Nm compress @@ -47,20 +49,42 @@ .Nm compress .Op Fl cdfgOqrtv123456789 .Op Fl b Ar bits +.Op Fl S Ar suffix .Op Fl o Ar filename .Op Ar .Nm uncompress -.Op Fl cfoqrtv +.Op Fl cfqrtv +.Op Fl o Ar filename +.Op Ar +.Pp +.Nm gzip +.Op Fl LV +.Nm gzip +.Op Fl cdfgOqrtv123456789 +.Op Fl b Ar bits +.Op Fl S Ar suffix +.Op Fl o Ar filename +.Op Ar +.Nm gunzip +.Op Fl cfqrtv .Op Fl o Ar filename .Op Ar +.Pp .Nm zcat .Op Fl fqr .Op Ar .Sh DESCRIPTION The -.Nm -utility -reduces the size of the named files using adaptive Lempel-Ziv coding. +.Nm compress +and +.Nm gzip +utilities +reduce the size of the named files using adaptive Lempel-Ziv coding. +They are functionally identical, except that if invoked as +.Nm gzip +the deflate mode of compression is chosen by default (see the +.Fl g +flag). Each .Ar file is renamed to the same name plus the extension @@ -79,7 +103,9 @@ is used). .Pp The .Nm uncompress -utility restores compressed files to their original form, renaming the +and +.Nm gunzip +utilities restore compressed files to their original form, renaming the files by removing the .Dq .Z or @@ -106,8 +132,6 @@ not removed, and the attributes of the input file are not retained. .Pp The options are as follows: .Bl -tag -width Ds -.It Fl L -Display the source code license and exit. .It Fl V Display the program version (RCS Ids of the source files) and exit. .It Fl b Ar bits @@ -132,6 +156,8 @@ Additionally, files are overwritten without prompting for confirmation. Use deflate scheme which reportedly provides better compression rates (force .Nm gzip mode). +This flag need not be specified when invoked as +.Nm gzip . .It Fl 1...9 Use deflate scheme with compression factor of one to nine. .It Fl O @@ -181,10 +207,16 @@ This allows the algorithm to adapt to the next .Dq block of the file. .Pp +.Nm gzip +uses a slightly different version of the Lempel-Ziv algorithm, +which can achieve even better compression. +.Pp The .Fl b flag is omitted for .Nm uncompress +or +.Nm gunzip since the .Ar bits parameter specified during compression @@ -192,7 +224,6 @@ is encoded within the output, along with a magic number to ensure that neither decompression of random data nor recompression of compressed data is attempted. .Pp -.ne 8 The amount of compression obtained depends on the size of the input, the number of .Ar bits @@ -205,7 +236,9 @@ time to compute. .Pp The .Nm -utility exits with 0 on success, 1 if an error occurred, or 2 if one or +and +.Nm gzip +utilities exit with 0 on success, 1 if an error occurred, or 2 if one or more files were not compressed because they would have grown in size (and .Fl f diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c index 07c4ffc81c6..7782dfe1c2c 100644 --- a/usr.bin/compress/main.c +++ b/usr.bin/compress/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.25 2003/06/22 15:22:43 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.26 2003/06/22 22:17:46 deraadt Exp $ */ static const char copyright[] = "@(#) Copyright (c) 1992, 1993\n\ @@ -35,7 +35,7 @@ static const char license[] = #if 0 static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #else -static const char main_rcsid[] = "$OpenBSD: main.c,v 1.25 2003/06/22 15:22:43 deraadt Exp $"; +static const char main_rcsid[] = "$OpenBSD: main.c,v 1.26 2003/06/22 22:17:46 deraadt Exp $"; #endif #endif /* not lint */ @@ -614,7 +614,7 @@ void usage(void) { fprintf(stderr, - "usage: %s [-cdfghlnLOqrStvV] [-b <bits>] [-[0-9]] [file ...]\n", + "usage: %s [-cdfgOqrtvV] [-b bits] [-S suffix] [-[1-9]] [file ...]\n", __progname); exit(1); } |