Skip to content
EntityQ291486· pop 9· linked from 175 articles

Also known as uncompress

Unix shell compression program

Described at

The compress utility shall attempt to reduce the size of the named files by using adaptive Lempel-Ziv coding algorithm. Lempel-Ziv is US Patent 4464650, issued to William Eastman, Abraham Lempel, Jacob Ziv, Martin Cohn on August 7th, 1984, and assigned to Sperry Corporation. On systems not supporting adaptive Lempel-Ziv coding algorithm, the input files shall not be changed and an error value greater than two shall be returned. Except when the output is to the standard output, each file shall be replaced by one with the extension .Z . If the invoking process has appropriate privileges, the ownership, modes, access time, and modification time of the original file are preserved. If appending the .Z to the filename would make the name exceed {NAME MAX} bytes, the command shall fail. If no files are specified, the standard input shall be compressed to the standard output. Cause compress to write to the standard output; the input file is not changed, and no .Z files are created. If file operands are specified, the input files contain the data to be compressed. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale for the behavior of ranges, equivalence classes, and multi-character collating elements used in the extended regular expression defined for the yesexpr locale keyword in the LC MESSAGES category. Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments), the behavior of character classes used in the extended regular expression defined for the yesexpr locale keyword in the LC MESSAGES category. Determine the locale used to process affirmative responses, and the locale used to affect the format and contents of diagnostic messages, prompts, and the output from the -v option written to standard error. Determine the location of message catalogs for the processing of LC MESSAGES. The standard error shall be used only for diagnostic and prompt messages and the output from -v . The output files shall contain the compressed output. The format of compressed files is unspecified and interchange of such files between implementations (including access via unspecified file sharing mechanisms) is not required by POSIX.1-2017. One or more files were not compressed because they would have increased in size (and the -f option was not specified). The amount of compression obtained depends on the size of the input, the number of bits per code, and the distribution of common substrings. Typically, text such as source code or English is reduced by 50-60%. Compression is generally much better than that achieved by Huffman coding or adaptive Huffman coding ( compact ), and takes less time to compute. Although compress strictly follows the default actions upon receipt of a signal or when an error occurs, some unexpected results may occur. In some implementations it is likely that a partially compressed file is left in place, alongside its uncompressed input file. Since the general operation of compress is to delete the uncompressed file only after the .Z file has been successfully filled, an application should always carefully check the exit status of compress before arbitrarily deleting files that have like-named neighbors with .Z suffixes. The normative text is reworded to avoid use of the term "must" for application requirements. An error case is added for systems not supporting adaptive Lempel-Ziv coding.

Excerpt from a page describing this subject · 9,234 chars · not written by Vinony

Wikidata facts

Show 5 more facts
has command line option
v
file extension
Z
media type
application/x-compressed
publication date
1985-02-00
Sources (4)

via Wikidata · CC0

Available in 9 languages

via Wikidata sitelinks · CC0

Connections

Categories