home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / compress / gnuzip_.zip / GZIP.DOC < prev    next >
Text File  |  1993-03-28  |  8KB  |  202 lines

  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.   If  no files are
  17.      specified, the standard input is compressed to the  standard
  18.      output.  If the new file name is too long, gzip truncates it
  19.      and keeps the original file name  in  the  compressed  file.
  20.      Gzip  will  only attempt to compress regular files.  In par-
  21.      ticular, it will ignore symbolic links.
  22.  
  23.      Compressed files can be  restored  to  their  original  form
  24.      using gzip -d or gunzip or zcat.
  25.  
  26.      gunzip takes a  list  of  files  on  its  command  line  and
  27.      replaces  each  file whose name ends with .z or .Z and which
  28.      begins with the correct magic number  with  an  uncompressed
  29.      file without the original extension.
  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.z format. To extract zip files with
  47.      several members, use unzip instead of gunzip.
  48.  
  49.      zcat is identical to gunzip -c. zcat uncompresses  either  a
  50.      list  of files on the command line or its standard input and
  51.      writes the uncompressed data on standard output.  zcat  will
  52.      uncompress  files that have the correct magic number whether
  53.      they have a .z suffix or not.
  54.  
  55.      Gzip uses the Lempel-Ziv algorithm used in  zip  and  PKZIP.
  56.      The  amount  of  compression obtained depends on the size of
  57.      the input and the distribution of common substrings.   Typi-
  58.      cally,  text  such  as  source code or English is reduced by
  59.      60-70%.  Compression is  generally  much  better  than  that
  60.      achieved  by  LZW  (as used in compress), Huffman coding (as
  61.      used in pack), or adaptive Huffman coding (compact).
  62.  
  63.      Compression is always performed, even if the compressed file
  64.      is  slightly larger than the original. The worst case expan-
  65.      sion is a few bytes for the gzip file header, plus  5  bytes
  66.      every  32K  block, or an expansion ratio of 0.015% for large
  67.      files.  gzip preserves the mode, ownership and timestamps of
  68.      files when compressing or decompressing.
  69.  
  70. OPTIONS
  71.      -c --stdout
  72.           Write output on standard output;  keep  original  files
  73.           unchanged.   If there are several input files, the out-
  74.           put consists of a sequence of independently  compressed
  75.           members.  To obtain better compression, concatenate all
  76.           input files before compressing them.
  77.  
  78.      -d --decompress
  79.           Decompress.
  80.  
  81.      -f --force
  82.           Force compression even if the file has  multiple  links
  83.           or  the corresponding .z file already exists.  If -f is
  84.           not given, and when not running in the background, gzip
  85.           prompts to verify whether an existing .z file should be
  86.           overwritten.
  87.  
  88.      -h --help
  89.           Display a help screen.
  90.  
  91.      -L --license
  92.           Display the gzip license.
  93.  
  94.      -r --recurse
  95.           Travel the directory structure recursively. If  any  of
  96.           the file names specified on the command line are direc-
  97.           tories,  gzip  will  descend  into  the  directory  and
  98.           compress  all  the  files it finds there (or decompress
  99.           them in the case of gunzip ).
  100.  
  101.      -t --test
  102.           Test. Check the compressed file integrity.
  103.  
  104.      -v --verbose
  105.           Verbose. Display the name and percentage reduction  for
  106.           each file compressed.
  107.  
  108.      -V --version
  109.           Version. Display the  version  number  and  compilation
  110.           options.
  111.  
  112.      -# --fast --best
  113.           Regulate the speed of compression using  the  specified
  114.           digit  #,  where  -1  or  --fast  indicates the fastest
  115.           compression method (less compression) and -9 or  --best
  116.           indicates   the  slowest  compression  method  (optimal
  117.           compression).  The default compression level is -5.
  118.  
  119. ADVANCED USAGE
  120.      Multiple compressed files can be concatenated. In this case,
  121.      gunzip will extract all members at once. For example:
  122.  
  123.            gzip -c file1  > foo.z
  124.            gzip -c file2 >> foo.z Then
  125.            gunzip -c foo
  126.  
  127.      is equivalent to
  128.  
  129.            cat file1 file2
  130.  
  131.      In case of damage to one member of a .z file, other  members
  132.      can  still  be recovered (if the damaged member is removed).
  133.      However, you can get better compression by  compressing  all
  134.      members at once:
  135.  
  136.            cat file1 file2 | gzip > foo.z
  137.  
  138.      compresses better than
  139.  
  140.            gzip -c file1 file2 > foo.z
  141.  
  142.      If you want to recompress concatenated files to  get  better
  143.      compression, do:
  144.  
  145.            zcat old.z | gzip > new.z
  146.  
  147. ENVIRONMENT
  148.      The environment variable GZIP can  hold  a  set  of  default
  149.      options  for  gzip.  These options are interpreted first and
  150.      can be ovewritten by explicit command line  parameters.  For
  151.      example:
  152.            for sh:   GZIP="-8 -v"; export GZIP
  153.            for csh:  setenv GZIP "-8 -v"
  154.  
  155. SEE ALSO
  156.      znew(1), zcmp(1), zmore(1),  zip(1),  compress(1),  pack(1),
  157.      compact(1)
  158.  
  159. DIAGNOSTICS
  160.      Exit status is normally 0; if an error occurs,  exit  status
  161.      is 1. If a warning occurs, exit status is 2.
  162.  
  163.      Usage: gzip [-cdfhLrtvV19] [file ...]
  164.              Invalid options were specified on the command line.
  165.      file: not in gzip format
  166.              The  file  specified  to   gunzip   has   not   been
  167.              compressed.
  168.      file: Corrupt input. Use zcat to recover some data.
  169.              The compressed file has been damaged. The data up to
  170.              the point of failure can be recovered using
  171.                      zcat file > recover
  172.      file: compressed with xx bits, can only handle yy bits
  173.              File was compressed (using LZW) by  a  program  that
  174.              could  deal  with more bits than the decompress code
  175.              on this machine.  Recompress  the  file  with  gzip,
  176.              which compresses better and uses less memory.
  177.      file: already has .z suffix -- no change
  178.              The  file  is  assumed  to  be  already  compressed.
  179.              Rename the file and try again.
  180.      file already exists; do you wish to overwrite (y or n)?
  181.              Respond "y" if  you  want  the  output  file  to  be
  182.              replaced; "n" if not.
  183.      gunzip: corrupt input
  184.              A SIGSEGV violation was detected which usually means
  185.              that the input file has been corrupted.
  186.      xx.x%
  187.              Percentage  of  the  input  saved  by   compression.
  188.              (Relevant only for -v.)
  189.      -- not a regular file or directory: ignored
  190.              When the input file is not a regular file or  direc-
  191.              tory,  (e.g.  a  symbolic link, socket, FIFO, device
  192.              file), it is left unaltered.
  193.      -- has xx other links: unchanged
  194.              The input file has links; it is left unchanged.  See
  195.              ln(1) for more information. Use the -f flag to force
  196.              compression of multiply-linked files.
  197.  
  198. CAVEATS
  199.      The .z extension is already used by pack(1).  You  can  link
  200.      gzip  to  pcat to get transparent decompression for programs
  201.      expecting .z files to be in pack format.
  202.