Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ compress(C) — OpenDesktop 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(CP)

cat(C)

pack(C)

tar(C)


 compress(C)                   06 January 1993                    compress(C)


 Name

    compress, uncompress, zcat - compress data for storage, uncompress and
    display compressed files

 Syntax

    compress [ -cdfFqv ] [ -H | -b bits ] file

    compress -P fd

    uncompress [ -fqcFv ] file

    uncompress [ -P fd ]

    zcat file

 Description

    The compress command takes a file and compresses it to a smaller size
    (without loss of information), creates a compressed output file, and
    removes the original file unless the -c option is present.  Compression
    is achieved by encoding common strings within the file.  uncompress
    restores a previously compressed file to its uncompressed state and
    removes the compressed version.  zcat uncompresses and displays a file on
    the standard output.

    If the -P fd option is specified, compress reads a list of filenames from
    the pipe associated with the file descriptor fd. One filename is read
    from each successive 1K block of data in the pipe.  Each filename is null
    terminated.  File names are read until a null character is encountered at
    the beginning of a block or the pipe is closed.  Each file is then
    compressed.  The output files have the same name as, and overwrite, the
    original files.  This option can also be used with uncompress.

    If no file is specified on the command line, input is taken from the
    standard input and the output is directed to the standard output. Output
    defaults to a file with the same filename as the input file with the suf-
    fix ``.Z'' or it can be directed through the standard output. The output
    files have the same permissions and ownership as the corresponding input
    files or the user's standard permissions if output is directed through
    the standard output.

    If no space is saved by compression, the output file is not written
    unless the -F flag is present on the command line.

    If you attempt to compress a symbolic link, the link will be broken and a
    compressed copy of the file to which the symbolic link pointed will be
    created locally.  compress will fail on a file with hard (non-symbolic)
    links.

 Options

    The following options are available from the command line:

    -b bits Specifies the maximum number of bits to use in encoding.

    -c      Writes output on the standard output and does not remove original
            file.

    -d      Decompresses a compressed file.

    -f      Overwrites previous output file.

    -F      Writes output file even if compression saves no space.

    -H      Compresses a file by approximately a further 20% using the LZH
            algorithm. uncompress(C) automatically detects when files have
            been compressed with this option and processes them accordingly.

    -q      Generates no output except error messages, if any.

    -v      Prints the name of the file being compressed, and the percentage
            of compression achieved. With uncompress, the name of the
            uncompressed file is printed.

 Notes

    The -P option is provided for internal use by tar(C).

    The -v option is not compatible with the -c option.

 See also

    ar(CP), cat(C) pack(C) and tar(C).

 Value added

    compress, uncompress and zcat are extensions of AT&T System V provided by
    The Santa Cruz Operation, Inc.


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