|
|
1.1 ! root 1: ! 2: GZIP(1) USER COMMANDS GZIP(1) ! 3: ! 4: NAME ! 5: gzip, gunzip, zcat - compress or expand files ! 6: ! 7: SYNOPSIS ! 8: gzip [ -cdfhLrtvV19 ] [ name ... ] ! 9: gunzip [ -cfhLrtvV ] [ name ... ] ! 10: zcat [ -hLV ] [ name ... ] ! 11: ! 12: DESCRIPTION ! 13: Gzip reduces the size of the named files using Lempel-Ziv ! 14: coding (LZ77). Whenever possible, each file is replaced by ! 15: one with the extension .z, while keeping the same ownership ! 16: modes, access and modification times. (The extension is -z ! 17: for VMS, z for MSDOS, OS/2 and Atari.) If no files are ! 18: specified, the standard input is compressed to the standard ! 19: output. If the new file name is too long, gzip truncates it ! 20: and keeps the original file name in the compressed file. ! 21: Gzip will only attempt to compress regular files. In par- ! 22: ticular, it will ignore symbolic links. ! 23: ! 24: Compressed files can be restored to their original form ! 25: using gzip -d or gunzip or zcat. ! 26: ! 27: gunzip takes a list of files on its command line and ! 28: replaces each file whose name ends with .z or .Z or -z and ! 29: which begins with the correct magic number with an ! 30: uncompressed file without the original extension. gunzip ! 31: also recognizes the special extensions .tgz and .taz as ! 32: shorthands for .tar.z or .tar.Z ! 33: ! 34: gunzip can currently decompress files created by gzip, zip, ! 35: compress or pack. The detection of the input format is ! 36: automatic. When using the first two formats, gunzip checks ! 37: a 32 bit CRC. For pack, gunzip checks the uncompressed ! 38: length. The compress format was not designed to allow con- ! 39: sistency checks. However gunzip is sometimes able to detect ! 40: a bad .Z file. If you get an error when uncompressing a .Z ! 41: file, do not assume that the .Z file is correct simply ! 42: because the standard uncompress does not complain. This gen- ! 43: erally means that the standard uncompress does not check its ! 44: input, and happily generates garbage output. ! 45: ! 46: Files created by zip can be uncompressed by gzip only if ! 47: they have a single member compressed with the 'deflation' ! 48: method. This feature is only intended to help conversion of ! 49: tar.zip files to the tar.z format. To extract zip files with ! 50: several members, use unzip instead of gunzip. ! 51: ! 52: zcat is identical to gunzip -c. (On some systems, zcat may ! 53: be installed as gzcat to preserve the original link to ! 54: compress.) zcat uncompresses either a list of files on the ! 55: command line or its standard input and writes the ! 56: ! 57: Sun Release 4.1 Last change: local 1 ! 58: ! 59: GZIP(1) USER COMMANDS GZIP(1) ! 60: ! 61: uncompressed data on standard output. zcat will uncompress ! 62: files that have the correct magic number whether they have a ! 63: .z suffix or not. ! 64: ! 65: Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP. ! 66: The amount of compression obtained depends on the size of ! 67: the input and the distribution of common substrings. Typi- ! 68: cally, text such as source code or English is reduced by ! 69: 60-70%. Compression is generally much better than that ! 70: achieved by LZW (as used in compress), Huffman coding (as ! 71: used in pack), or adaptive Huffman coding (compact). ! 72: ! 73: Compression is always performed, even if the compressed file ! 74: is slightly larger than the original. The worst case expan- ! 75: sion is a few bytes for the gzip file header, plus 5 bytes ! 76: every 32K block, or an expansion ratio of 0.015% for large ! 77: files. gzip preserves the mode, ownership and timestamps of ! 78: files when compressing or decompressing. ! 79: ! 80: OPTIONS ! 81: -c --stdout ! 82: Write output on standard output; keep original files ! 83: unchanged. If there are several input files, the out- ! 84: put consists of a sequence of independently compressed ! 85: members. To obtain better compression, concatenate all ! 86: input files before compressing them. ! 87: ! 88: -d --decompress ! 89: Decompress. ! 90: ! 91: -f --force ! 92: Force compression or decompression even if the file has ! 93: multiple links or the corresponding file already ! 94: exists. If -f is not given, and when not running in ! 95: the background, gzip prompts to verify whether an ! 96: existing file should be overwritten. ! 97: ! 98: -h --help ! 99: Display a help screen. ! 100: ! 101: -L --license ! 102: Display the gzip license. ! 103: ! 104: -q --quiet ! 105: Suppress all warnings. ! 106: ! 107: -r --recurse ! 108: Travel the directory structure recursively. If any of ! 109: the file names specified on the command line are direc- ! 110: tories, gzip will descend into the directory and ! 111: compress all the files it finds there (or decompress ! 112: ! 113: Sun Release 4.1 Last change: local 2 ! 114: ! 115: GZIP(1) USER COMMANDS GZIP(1) ! 116: ! 117: them in the case of gunzip ). ! 118: ! 119: -t --test ! 120: Test. Check the compressed file integrity. ! 121: ! 122: -v --verbose ! 123: Verbose. Display the name and percentage reduction for ! 124: each file compressed. ! 125: ! 126: -V --version ! 127: Version. Display the version number and compilation ! 128: options. ! 129: ! 130: -# --fast --best ! 131: Regulate the speed of compression using the specified ! 132: digit #, where -1 or --fast indicates the fastest ! 133: compression method (less compression) and -9 or --best ! 134: indicates the slowest compression method (optimal ! 135: compression). The default compression level is -5. ! 136: ! 137: ADVANCED USAGE ! 138: Multiple compressed files can be concatenated. In this case, ! 139: gunzip will extract all members at once. For example: ! 140: ! 141: gzip -c file1 > foo.z ! 142: gzip -c file2 >> foo.z Then ! 143: gunzip -c foo ! 144: ! 145: is equivalent to ! 146: ! 147: cat file1 file2 ! 148: ! 149: In case of damage to one member of a .z file, other members ! 150: can still be recovered (if the damaged member is removed). ! 151: However, you can get better compression by compressing all ! 152: members at once: ! 153: ! 154: cat file1 file2 | gzip > foo.z ! 155: ! 156: compresses better than ! 157: ! 158: gzip -c file1 file2 > foo.z ! 159: ! 160: If you want to recompress concatenated files to get better ! 161: compression, do: ! 162: ! 163: zcat old.z | gzip > new.z ! 164: ! 165: ENVIRONMENT ! 166: The environment variable GZIP can hold a set of default ! 167: options for gzip. These options are interpreted first and ! 168: can be ovewritten by explicit command line parameters. For ! 169: ! 170: Sun Release 4.1 Last change: local 3 ! 171: ! 172: GZIP(1) USER COMMANDS GZIP(1) ! 173: ! 174: example: ! 175: for sh: GZIP="-8 -v"; export GZIP ! 176: for csh: setenv GZIP "-8 -v" ! 177: for MSDOS: set GZIP=-8 -v ! 178: ! 179: On Vax/VMS, the name of the environment variable is ! 180: GZIP_OPT, to avoid a conflict with the symbol set for invo- ! 181: cation of the program. ! 182: ! 183: SEE ALSO ! 184: znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), ! 185: unzip(1), compress(1), pack(1), compact(1) ! 186: ! 187: DIAGNOSTICS ! 188: Exit status is normally 0; if an error occurs, exit status ! 189: is 1. If a warning occurs, exit status is 2. ! 190: ! 191: Usage: gzip [-cdfhLrtvV19] [file ...] ! 192: Invalid options were specified on the command line. ! 193: file: not in gzip format ! 194: The file specified to gunzip has not been ! 195: compressed. ! 196: file: Corrupt input. Use zcat to recover some data. ! 197: The compressed file has been damaged. The data up to ! 198: the point of failure can be recovered using ! 199: zcat file > recover ! 200: file: compressed with xx bits, can only handle yy bits ! 201: File was compressed (using LZW) by a program that ! 202: could deal with more bits than the decompress code ! 203: on this machine. Recompress the file with gzip, ! 204: which compresses better and uses less memory. ! 205: file: already has z suffix -- no change ! 206: The file is assumed to be already compressed. ! 207: Rename the file and try again or use zcat. ! 208: file already exists; do you wish to overwrite (y or n)? ! 209: Respond "y" if you want the output file to be ! 210: replaced; "n" if not. ! 211: gunzip: corrupt input ! 212: A SIGSEGV violation was detected which usually means ! 213: that the input file has been corrupted. ! 214: xx.x% ! 215: Percentage of the input saved by compression. ! 216: (Relevant only for -v.) ! 217: -- not a regular file or directory: ignored ! 218: When the input file is not a regular file or direc- ! 219: tory, (e.g. a symbolic link, socket, FIFO, device ! 220: file), it is left unaltered. ! 221: -- has xx other links: unchanged ! 222: The input file has links; it is left unchanged. See ! 223: ln(1) for more information. Use the -f flag to force ! 224: compression of multiply-linked files. ! 225: ! 226: Sun Release 4.1 Last change: local 4 ! 227: ! 228: GZIP(1) USER COMMANDS GZIP(1) ! 229: ! 230: CAVEATS ! 231: The .z extension is already used by pack(1). You can link ! 232: gzip to pcat to get transparent decompression for programs ! 233: expecting .z files to be in pack format. ! 234: ! 235: Sun Release 4.1 Last change: local 5 ! 236:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.