home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma74.lha / MAShare74 / unsit1.5c.amiga / docs / compress.man < prev    next >
Text File  |  1991-09-08  |  5KB  |  115 lines

  1.  
  2. COMPRESS(1)                          BSD                           COMPRESS(1)
  3.  
  4.  
  5.  
  6. NAME
  7.      compress, uncompress, zcat - compress and expand data
  8.  
  9. SYNOPSIS
  10.      compress [ -f ] [ -v ] [ -c ] [ -b bits ] [ file ... ]
  11.      uncompress [ -f ] [ -v ] [ -c ] [ file ... ]
  12.      zcat [ file ... ]
  13.  
  14. DESCRIPTION
  15.      compress reduces the size of the named files using adaptive Lempel-Ziv
  16.      coding.  Whenever possible, each file is replaced by one with the
  17.      extension .Z, while keeping the same ownership modes, access, and
  18.      modification times.  If you do not specify a file, compress compresses
  19.      the standard input to the standard output.  Use uncompress or zcat to
  20.      restore compressed files to their original form.
  21.  
  22.      compress uses the modified Lempel-Ziv algorithm popularized in "A
  23.      Technique for High Performance Data Compression", Terry A. Welch, IEEE
  24.      Computer, vol. 17, no. 6 (June 1984), pp. 8-19.  Common substrings in the
  25.      file are first replaced by 9-bit codes 257 and up.  When code 512 is
  26.      reached, the algorithm switches to 10-bit codes and continues to use more
  27.      bits until the limit specified by the -b flag is reached (default 16).
  28.      bits must be between 9 and 16.  You can change the default in the source
  29.      to allow compress to be run on a smaller machine.
  30.  
  31.      After the bits limit is attained, compress periodically checks the
  32.      compression ratio.  If it is increasing, compress continues to use the
  33.      existing code dictionary.  However, if the compression ratio decreases,
  34.      compress discards the table of substrings and rebuilds it from scratch.
  35.      This allows the algorithm to adapt to the next "block" of the file.
  36.  
  37.      Note that the -b flag is omitted for uncompress, since the bits parameter
  38.      specified during compression is encoded within the output, along with a
  39.      magic number to ensure that neither decompression of random data nor
  40.      recompression of compressed data is attempted.
  41.  
  42.      The amount of compression obtained depends on the size of the input, the
  43.      number of bits per code, and the distribution of common substrings.
  44.      Typically, text such as source code or English is reduced by 50-60
  45.      percent.  Compression is generally much better than that achieved by
  46.      Huffman coding (as used in pack), or adaptive Huffman coding (compact),
  47.      and takes less time to compute.
  48.  
  49.      Exit status is normally 0; if the last file is larger after (attempted)
  50.      compression, the status is 2; if an error occurs, the exit status is 1.
  51.  
  52. OPTIONS
  53.      -f        Forces compression of file.  This option is useful for
  54.                compressing an entire directory, even if some of the files
  55.                don't actually shrink. If you don't specify -f, and compress is
  56.                run in the foreground, you are asked whether an existing file
  57.                should be overwritten
  58.  
  59.      -v        Causes the printing of the percentage reduction of each file.
  60.  
  61.      -c        ("cat") Makes compress/uncompress write to the standard output;
  62.                no files are changed.  The nondestructive behavior of zcat is
  63.                identical to that of uncompress -c.
  64.  
  65.      -b bits   Determines the maximum number of bits to be used in the
  66.                encoding scheme. bits must be between 9 and 16. The default is
  67.                16.
  68.  
  69. DIAGNOSTICS
  70.      Usage: compress [-fvc] [-b maxbits] [file ...]
  71.              Invalid options were specified on the command line.
  72.      Missing maxbits
  73.              Maxbits must follow -b.
  74.      file:  not in compressed format
  75.              The file specified to uncompress has not been compressed.
  76.      file:  compressed with xx bits, can handle only yy bits
  77.              File was compressed by a program that could deal with more bits
  78.              than the compress code on this machine.  Recompress the file with
  79.              smaller bits.
  80.      file:  already has .Z suffix -- no change
  81.              The file is assumed to be already compressed.  Rename the file
  82.              and try again.
  83.      file:  filename too long to tack on .Z
  84.              The file cannot be compressed because its name is longer than 12
  85.              characters.  Rename and try again.
  86.      file already exists; do you wish to overwrite (y or n)?
  87.              Respond "y" if you want the output file to be replaced; "n" if
  88.              not.
  89.      uncompress: corrupt input
  90.              A SIGSEGV violation was detected which usually means that the
  91.              input file is corrupted.
  92.      Compression: xx.xx%
  93.              Percentage of the input saved by compression.  (Relevant only for
  94.              -v.)
  95.      -- not a regular file: unchanged
  96.              When the input file is not a regular file, (for example, a
  97.              directory), it is left unchanged.
  98.      -- has xx other links: unchanged
  99.              The input file has links; it is left unchanged.  See ln(1) for
  100.              more information.
  101.      -- file unchanged
  102.              No savings is achieved by compression.  The input remains
  103.              unchanged.
  104.  
  105. BUGS
  106.      Files that were compressed using the older compact(1) utility must be
  107.      expanded with uncompact(1).
  108.  
  109.      Although compressed files are compatible between machines with large
  110.      memory, you should use -b12 for file transfer to architectures with a
  111.      small process data space (64KB or less).
  112.  
  113.      Ideally compress would be more flexible about the existence of the .Z
  114.      suffix.
  115.