home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR40 / GZIP110X.ZIP / GZIP110.EXE / GZIP.DOC < prev    next >
Text File  |  1993-05-27  |  10KB  |  234 lines

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