Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ compress(1) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pack(1)

pcat(1)

uncompress(1)

unpack(1)

zcat(1)

compress(1)                                                     compress(1)

NAME
     compress - compress files

SYNOPSIS
     compress [option ...] [file ...]

DESCRIPTION
     compress reduces the size of files using adaptive Lempel-Ziv coding:
     recurrent strings in the text are reduced to unique codes ranging from
     9 to a maximum of 16 bits.

     On systems which evaluate the RSTCHOWN variable, the user who invokes
     compress is made the owner of the compressed file (unless the invoking
     user is the system administrator). On other systems the owner stays
     the same.

     The access permissions, and the dates of last access and modification
     stay the same. Each file is replaced by a file with the same basename
     plus a .Z extension.

     The amount of compression obtained depends on the size of the input
     file, the value of maxbits (see option -b below), and the distribution
     of recurrent substrings. Typically, files containing only text or
     source code are reduced by 50-60%. Compression achieved with the
     Lempel-Ziv approach is generally much better than that achieved with
     Huffman coding [see pack(1)], and takes less time to compute.

     No compression is performed if

     -  the input file is not a regular file (if it is a directory, for
        example)

     -  there are other links to the input file

     -  the input file already has a .Z extension

     -  the .Z file to be created already exists, and compress is being
        executed in the background (/usr/bin/sh)

     -  no savings can be achieved by compression

     Files compressed with compress can be decompressed with uncompress(1).

     zcat(1) produces uncompressed output on the standard output, but
     leaves the compressed file intact.










Page 1                       Reliant UNIX 5.44                Printed 11/98

compress(1)                                                     compress(1)

OPTIONS
     No option specified:
          The specified files are compressed if storage space can be saved
          as a result.

     -c   Simply writes the output of compress to standard output without
          modifying or creating any files. Only one file may be specified
          for -c.

     -f   Forces compression even if no space savings will be achieved or
          the .Z file that will be created already exists. If the .Z file
          already exists it will be overwritten.

          -f not specified:

          compress prompts to verify whether an existing .Z file should be
          overwritten. No prompt is issued if compress is running in the
          background.

     -v   (verbose) Displays the percentage reduction for each file
          compressed:

          file Compression: xx.xx% -- replaced with file.Z

     -b maxbits
          Sets the maximum size (in bits) for recurrent substring codes to
          maxbits. The value for maxbits must be between 9 and 16. Lowering
          the number of bits will result in larger, less compressed files.

          The maxbits parameter specified during compression is encoded
          within the compressed file, together with a magic number to
          ensure that it is impossible to further compress a file which is
          already compressed.

          -b not specified: The value of maxbits defaults to 16.

          Caution:  Although compressed files are compatible between
                    machines with large memory, the -b 12 option should be
                    used for file transfer to architectures with a small
                    process data space (64 Kb or less).

     --   If file begins with a dash (-), the end of the command-line
          options must be marked with --.

     file Name of the file to be compressed. You may specify more than one
          file. If you specified a dash - for one of the files, compress
          reads from the standard input at this point.

          file must not be a directory and there must be no other links to
          it.




Page 2                       Reliant UNIX 5.44                Printed 11/98

compress(1)                                                     compress(1)

          The compressed file is assigned the name file.Z, and the named
          file is deleted after successful compression. file.Z has the same
          access permissions, access time and modification time as file.
          The maximum length of the name of file depends on the file system
          being used. The maximum allowable length is equal to the maximum
          file name length supported by the file system, minus 2 charac-
          ters. This allows for the extension to file.Z. If this length is
          exceeded, file will not be compressed. No .Z files are created
          for the standard input, the data is written in compressed form to
          standard output.

          Caution:  If compress is running in the background, an existing
                    .Z file is overwritten without a prompt.

          file not specified:

          Data from standard input is written in compressed form to stan-
          dard output.

EXIT STATUS
     0    Compression successful

     1    Error

     2    Compression not performed, as it would have increased the size of
          one or more files. (Can only occur if -f was not specified.)

     >2   Error

ERROR MESSAGES

     file: filename too long to tack on .Z

          The name of the compressed file is too long. No compression takes
          place.

     file  -- not a regular file: unchanged

          If the input file is not a regular file it is left uncompressed.

     file: -- has xx other links: unchanged

          The input file has xx other links; it is left uncompressed.

     file  unchanged

          No savings can be achieved by compression. The input file remains
          uncompressed. The -f option can be used to force compression.






Page 3                       Reliant UNIX 5.44                Printed 11/98

compress(1)                                                     compress(1)

LOCALE
     The LCMESSAGES environment variable governs the language in which
     message texts are displayed. If LCMESSAGES is undefined or is defined
     as the null string, it defaults to the value of LANG. If LANG is like-
     wise undefined or null, the system acts as if it were not internation-
     alized.

     Answers to yes/no queries must be given in the language appropriate to
     the current locale.

     The LCALL environment variable governs the entire locale. LCALL
     takes precedence over all the other environment variables which affect
     internationalization.

EXAMPLES
     The file films, which occupies 4862 bytes in uncompressed form, is to
     be compressed.

     $ ls -l
     total 10
     -rw-------  1  felix    group1     4862 Aug 19 09:27 films
     $ compress -v films
     compress: films: 50.78% Compression -- replaced with films.Z
     $ ls -l
     total 6
     -rw-------  1  felix    group1     2393 Aug 19 09:27 films.Z

SEE ALSO
     pack(1), pcat(1), uncompress(1), unpack(1), zcat(1).

























Page 4                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026