home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / gigop806.zip / GZIP.DOC < prev    next >
Text File  |  1994-07-28  |  17KB  |  370 lines

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