home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / UTIL_ARC / GZIP123.ZIP / GZIP.DOC < prev    next >
Text File  |  1993-06-24  |  14KB  |  318 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 [ -acdfhlLnrtvV19 ] [-S suffix] [ name ... ]
  9.      gunzip [ -acfhlLnrtvV ] [-S suffix] [ name ... ]
  10.      zcat [ -fhLV ] [ 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 .gz, while keeping the same ownership
  16.      modes,  access  and modification times.  (The default exten-
  17.      sion is -gz for VMS, z for MSDOS, OS/2 FAT and Atari.) If no
  18.      files are specified, the standard input is compressed to the
  19.      standard output.  Gzip will only attempt to compress regular
  20.      files.  In particular, it will ignore symbolic links.
  21.  
  22.      If the new file name is too long for its file  system,  gzip
  23.      truncates  it  and  keeps  the  original  file  name  in the
  24.      compressed file.  Gzip attempts to truncate only  the  parts
  25.      of  the file name longer than 3 characters.  (A part is del-
  26.      imited by dots.) If the name consists of small  parts  only,
  27.      the  longest parts are truncated. For example, if file names
  28.      are limited to 14 characters, gzip.msdos.exe  is  compressed
  29.      to gzi.msd.exe.gz.  Names are not truncated on systems which
  30.      do not have a limit on file name length.
  31.  
  32.      Compressed files can be  restored  to  their  original  form
  33.      using  gzip -d or gunzip or zcat. If the original name saved
  34.      in the compressed file is not suitable for its file  system,
  35.      a  new  name is constructed from the original one to make it
  36.      legal.
  37.  
  38.      gunzip takes a  list  of  files  on  its  command  line  and
  39.      replaces each file whose name ends with .gz, -gz, .z, -z, _z
  40.      or .Z and which begins with the correct magic number with an
  41.      uncompressed  file  without  the original extension.  gunzip
  42.      also recognizes the special  extensions  .tgz  and  .taz  as
  43.      shorthands   for  .tar.gz  and  .tar.Z  respectively.   When
  44.      compressing, gzip  uses  the  .tgz  extension  if  necessary
  45.      instead of truncating a file with a .tar extension.
  46.  
  47.      gunzip can currently decompress files created by gzip,  zip,
  48.      compress,  compress  -H  or pack. The detection of the input
  49.      format is automatic.  When using the first two formats, gun-
  50.      zip  checks  a  32  bit  CRC.  For  pack,  gunzip checks the
  51.      uncompressed length. The standard compress  format  was  not
  52.      designed  to  allow  consistency  checks.  However gunzip is
  53.      sometimes able to detect a bad .Z file. If you get an  error
  54.      when uncompressing a .Z file, do not assume that the .Z file
  55.      is correct simply because the standard uncompress  does  not
  56.      complain.  This generally means that the standard uncompress
  57.      does not check its input, and happily generates garbage out-
  58.      put.   The  SCO  compress -H format (lzh compression method)
  59.      does not include a CRC  but  also  allows  some  consistency
  60.      checks.
  61.  
  62.      Files created by zip can be uncompressed  by  gzip  only  if
  63.      they  have  a  single member compressed with the 'deflation'
  64.      method. This feature is only intended to help conversion  of
  65.      tar.zip  files  to  the  tar.gz format. To extract zip files
  66.      with several members, use unzip instead of gunzip.
  67.  
  68.      zcat is identical to gunzip -c. (On some systems,  zcat  may
  69.      be  installed  as  gzcat  to  preserve  the original link to
  70.      compress.) zcat uncompresses either a list of files  on  the
  71.      command   line   or   its  standard  input  and  writes  the
  72.      uncompressed data on standard output.  zcat will  uncompress
  73.      files that have the correct magic number whether they have a
  74.      .gz suffix or not.
  75.  
  76.      Gzip uses the Lempel-Ziv algorithm used in  zip  and  PKZIP.
  77.      The  amount  of  compression obtained depends on the size of
  78.      the input and the distribution of common substrings.   Typi-
  79.      cally,  text  such  as  source code or English is reduced by
  80.      60-70%.  Compression is  generally  much  better  than  that
  81.      achieved  by  LZW  (as used in compress), Huffman coding (as
  82.      used in pack), or adaptive Huffman coding (compact).
  83.  
  84.      Compression is always performed, even if the compressed file
  85.      is  slightly larger than the original. The worst case expan-
  86.      sion is a few bytes for the gzip file header, plus  5  bytes
  87.      every  32K  block, or an expansion ratio of 0.015% for large
  88.      files. Note that the  actual  number  of  used  disk  blocks
  89.      almost  never increases.  gzip preserves the mode, ownership
  90.      and timestamps of files when compressing or decompressing.
  91.  
  92. OPTIONS
  93.      -a --ascii
  94.           Ascii text mode: convert end-of-lines using local  con-
  95.           ventions.  This  option  is supported only on some non-
  96.           Unix systems. For MSDOS, CR LF is converted to LF  when
  97.           compressing,   and  LF  is  converted  to  CR  LF  when
  98.           decompressing.
  99.  
  100.      -c --stdout --to-stdout
  101.           Write output on standard output;  keep  original  files
  102.           unchanged.   If there are several input files, the out-
  103.           put consists of a sequence of independently  compressed
  104.           members.  To obtain better compression, concatenate all
  105.           input files before compressing them.
  106.  
  107.      -d --decompress --uncompress
  108.           Decompress.
  109.  
  110.      -f --force
  111.           Force compression or decompression even if the file has
  112.           multiple   links  or  the  corresponding  file  already
  113.           exists, or if the compressed data is read from or writ-
  114.           ten to a terminal. If the input data is not in a format
  115.           recognized by gzip, and if the option --stdout is  also
  116.           given,  copy the input data without change to the stan-
  117.           dard ouput: let zcat behave as cat. If -f is not given,
  118.           and when not running in the background, gzip prompts to
  119.           verify whether an existing file should be overwritten.
  120.  
  121.      -h --help
  122.           Display a help screen and quit.
  123.  
  124.      -l --list
  125.           For each compressed file, list the following fields:
  126.  
  127.               compressed size: size of the compressed file
  128.               uncompressed size: size of the uncompressed file
  129.               ratio: compression ratio (0.0% if unknown)
  130.               uncompressed_name: name of the uncompressed file
  131.  
  132.           The uncompressed size is given as -1 for files  not  in
  133.           gzip  format,  such  as compressed .Z files. To get the
  134.           uncompressed size for such a file, you can use:
  135.  
  136.               zcat file.Z | wc -c
  137.  
  138.           In combination with the --verbose option, the following
  139.           fields are also displayed:
  140.  
  141.               method: compression method
  142.               crc: the 32-bit CRC of the uncompressed data
  143.               date & time: time stamp for the uncompressed file
  144.  
  145.           The  compression  methods   currently   supported   are
  146.           deflate, compress, lzh (SCO compress -H) and pack.  The
  147.           crc is given as ffffffff for a file not in gzip format.
  148.  
  149.           With --verbose, the size totals and  compression  ratio
  150.           for  all files is also displayed, unless some sizes are
  151.           unknown. With --quiet, the title and totals  lines  are
  152.           not displayed.
  153.  
  154.      -L --license
  155.           Display the gzip license and quit.
  156.  
  157.      -n --no-name
  158.           When compressing, do not save the original file name by
  159.           default. (The original name is always saved if the name
  160.           had  to  be  truncated.)  When  decompressing,  do  not
  161.           restore  the original file name if present: remove only
  162.           the gzip suffix from the compressed file name.
  163.  
  164.      -q --quiet
  165.           Suppress all warnings.
  166.  
  167.      -r --recurse
  168.           Travel the directory structure recursively. If  any  of
  169.           the file names specified on the command line are direc-
  170.           tories,  gzip  will  descend  into  the  directory  and
  171.           compress  all  the  files it finds there (or decompress
  172.           them in the case of gunzip ).
  173.  
  174.      -S .suf --suffix .suf
  175.           Use suffix .suf instead  of  .gz.  Any  suffix  can  be
  176.           given,  but  suffixes  other  than .z and .gz should be
  177.           avoided to avoid confusion when files  are  transferred
  178.           to   other.   A  null  suffix  forces  gunzip  to   try
  179.           decompression on all given files regardless of  suffix,
  180.           as in:
  181.  
  182.               gunzip -S "" *       (*.* for MSDOS)
  183.  
  184.           Previous versions of gzip used the .z suffix. This  was
  185.           changed to avoid a conflict with pack(1).
  186.  
  187.      -t --test
  188.           Test. Check the compressed file integrity.
  189.  
  190.      -v --verbose
  191.           Verbose. Display the name and percentage reduction  for
  192.           each file compressed or decompressed.
  193.  
  194.      -V --version
  195.           Version. Display the  version  number  and  compilation
  196.           options then quit.
  197.  
  198.      -# --fast --best
  199.           Regulate the speed of compression using  the  specified
  200.           digit  #,  where  -1  or  --fast  indicates the fastest
  201.           compression method (less compression) and -9 or  --best
  202.           indicates   the  slowest  compression  method  (optimal
  203.           compression).  The  default  compression  level  is  -6
  204.           (that is, biased towards high compression at expense of
  205.           speed).
  206.  
  207. ADVANCED USAGE
  208.      Multiple compressed files can be concatenated. In this case,
  209.      gunzip will extract all members at once. For example:
  210.  
  211.            gzip -c file1  > foo.gz
  212.            gzip -c file2 >> foo.gz
  213.  
  214.      Then
  215.            gunzip -c foo
  216.  
  217.      is equivalent to
  218.  
  219.            cat file1 file2
  220.  
  221.      In case of damage to one member of a .gz file, other members
  222.      can  still  be recovered (if the damaged member is removed).
  223.      However, you can get better compression by  compressing  all
  224.      members at once:
  225.  
  226.            cat file1 file2 | gzip > foo.gz
  227.  
  228.      compresses better than
  229.  
  230.            gzip -c file1 file2 > foo.gz
  231.  
  232.      If you want to recompress concatenated files to  get  better
  233.      compression, do:
  234.  
  235.            zcat old.gz | gzip > new.gz
  236.  
  237.      If a  compressed  file  consists  of  several  members,  the
  238.      uncompressed  size  and  CRC  reported  by the --list option
  239.      applies to the last member only.
  240.  
  241. ENVIRONMENT
  242.      The environment variable GZIP can  hold  a  set  of  default
  243.      options  for  gzip.  These options are interpreted first and
  244.      can be overwritten by explicit command line parameters.  For
  245.      example:
  246.            for sh:    GZIP="-8 -v"; export GZIP
  247.            for csh:   setenv GZIP "-8 -v"
  248.            for MSDOS: set GZIP=-8 -v
  249.  
  250.      On  Vax/VMS,  the  name  of  the  environment  variable   is
  251.      GZIP_OPT,  to avoid a conflict with the symbol set for invo-
  252.      cation of the program.
  253.  
  254. SEE ALSO
  255.      znew(1), zcmp(1),  zmore(1),  zforce(1),  gzexe(1),  zip(1),
  256.      unzip(1), compress(1), pack(1), compact(1)
  257.  
  258. DIAGNOSTICS
  259.      Exit status is normally 0; if an error occurs,  exit  status
  260.      is 1. If a warning occurs, exit status is 2.
  261.  
  262.      Usage: gzip [-cdfhlLnrtvV19] [-S suffix] [file ...]
  263.              Invalid options were specified on the command line.
  264.      file: not in gzip format
  265.              The  file  specified  to   gunzip   has   not   been
  266.              compressed.
  267.      file: Corrupt input. Use zcat to recover some data.
  268.              The compressed file has been damaged. The data up to
  269.              the point of failure can be recovered using
  270.                      zcat file > recover
  271.      file: compressed with xx bits, can only handle yy bits
  272.              File was compressed (using LZW) by  a  program  that
  273.              could  deal  with more bits than the decompress code
  274.              on this machine.  Recompress  the  file  with  gzip,
  275.              which compresses better and uses less memory.
  276.      file: already has .gz suffix -- no change
  277.              The  file  is  assumed  to  be  already  compressed.
  278.              Rename the file and try again.
  279.      file already exists; do you wish to overwrite (y or n)?
  280.              Respond "y" if  you  want  the  output  file  to  be
  281.              replaced; "n" if not.
  282.      gunzip: corrupt input
  283.              A SIGSEGV violation was detected which usually means
  284.              that the input file has been corrupted.
  285.      xx.x%
  286.              Percentage  of  the  input  saved  by   compression.
  287.              (Relevant only for -v and -l.)
  288.      -- not a regular file or directory: ignored
  289.              When the input file is not a regular file or  direc-
  290.              tory,  (e.g.  a  symbolic link, socket, FIFO, device
  291.              file), it is left unaltered.
  292.      -- has xx other links: unchanged
  293.              The input file has links; it is left unchanged.  See
  294.              ln(1) for more information. Use the -f flag to force
  295.              compression of multiply-linked files.
  296.  
  297. CAVEATS
  298.      When writing compressed data to  a  tape,  it  is  generally
  299.      necessary  to pad the output with zeroes up to a block boun-
  300.      dary. When the data is read and the whole block is passed to
  301.      gunzip for decompression, gunzip detects that there is extra
  302.      trailing garbage after the compressed data and emits a warn-
  303.      ing  by  default.  You  have  to  use  the --quiet option to
  304.      suppress the warning. This option can be  set  in  the  GZIP
  305.      environment variable as in:
  306.          for sh:    GZIP="-q"  tar xfz /dev/rmt/datn
  307.          for csh:   (setenv GZIP "-q"; tar xfz /dev/rmt/datn)
  308.  
  309.      In the above example, gzip is invoked implicitly by  the  -z
  310.      option  of  GNU  tar. Make sure that the same block size (-b
  311.      option of tar) is used for reading  and  writing  compressed
  312.      data on tapes.
  313.  
  314. BUGS
  315.      The --list option reports incorrect sizes if they  exceed  2
  316.      gigabytes.  The --list option reports sizes as -1 and crc as
  317.      ffffffff if the compressed file is on a non seekable media.
  318.