Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

uncompress - expand compressed files

&pagelevel(4)&pagelevel

uncompress expands files compressed by compress and restores them to their original form. If the calling process has the appropriate privileges, the owner, access permissions, and the access and modification times are not changed.

Whenever possible, each file specified is replaced by a file with the same name but without the .Z extension.

Expansion is not performed if

  • the file to be created already exists and uncompress is running in the background

  • the specified file was compressed with a higher value for maxbits (see compress -b) than your current system can process.

  • there are links to the compressed file.


Syntax


uncompress[ -cvf][ file ...]

No option specified

The specified files are expanded.

-c

uncompress writes the expanded files to standard output. No files are modified or created. uncompress -c has exactly the same effect as zcat.

-f

(force)

file.Z is expanded even if a file named file already exists. file is overwritten.

-f not specified:
uncompress asks whether the existing file should be overwritten or not. You are not asked for confirmation, however, when uncompress is running in the background. The specified file is not expanded.

-v

(verbose)

uncompress issues a message confirming successful expansion.

file.Z: –– replaced with file

file

Name of a file compressed with compress. You can specify more than one file. Each file name must include a .Z suffix which you do not have to specify when invoking uncompress. The expanded file is assigned the name file. file.Z is deleted after being successfully expanded (unless the -c option is specified). Access permissions, access and modification dates, and the owner of the file remain unchanged.

Error

file.Z: not in compressed format

The specified file is not available in compressed format or is a directory.


file.Z: compressed with xxbits, can only handle yybits

The specified file was compressed with too high a value for maxbits (see compress -b). The system on which you called uncompress cannot process this value. Compress the file again using the value specified as yy in the error message or with a lower value.


file.Z: –– has xx other links: unchanged

There are xx links to the specified file. The file is not expanded.


uncompress: corrupt input

The SIGSEGV signal (segmentation violation; an addressing error caused by unauthorized segment access) was received, which normally indicates that the input file is corrupted.

Locale

The following environment variables affect the execution of uncompress:

LANG

Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL

If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE

Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files), the classification of characters as upper- to lower-case, and the mapping of characters from one case to the other.

LC_MESSAGES

Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

NLSPATH

Determine the location of message catalogs for the processing of LC_MESSAGES.

Example

You want to expand the file topsecret.Z. The same directory already contains a file called topsecret, but this can be overwritten.

$ ls -l
total 62

-rw-------  1  felix    group1    4862 Mar 12 10:16 topsecret

-rw-------  1  felix    group1   26326 Feb 08 10:27 topsecret.Z

$ uncompress -v topsecret.Z

topsecret already exists; do you wish to overwrite topsecret (y or n)? y

topsecret.Z: -- replaced with topsecret

$ ls -l

total 138

-rw-------  1  felix    group1   69845 Feb 08 10:27 topsecret

See also

compress, zcat