[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 System User's Guide: Operating System and Devices

Expanding Compressed Files (uncompress and unpack Commands)

You can expand compressed files with the uncompress and unpack commands.

uncompress Command

The uncompress command restores original files that were compressed by the compress command. Each compressed file specified by the File variable is removed and replaced by an expanded copy. The expanded file has the same name as the compressed version, but without the .Z extension. The expanded file retains the same ownership, modes, and access and modification times as the original file. If no files are specified, standard input is expanded to standard output.

Although similar to the uncompress command, the zcat command always writes the expanded output to standard output.

For example, to uncompress the foo file, enter:

uncompress foo

See the uncompress command in theAIX Version 4.3 Commands Reference for the exact syntax.

unpack Command

The unpack command expands files created by the pack command. For each file specified, the unpack command searches for a file called File.z. If this file is a packed file, the unpack command replaces it by its expanded version. The unpack command renames the new file by removing the .z suffix from File. The new file has the same access modes, access and modification dates, and owner as the original packed file.

The unpack command operates only on files ending in .z. As a result, when you specify a file name that does not end in .z, the unpack command adds the suffix and searches the directory for a file name with that suffix.

The exit value is the number of files the unpack command was unable to unpack. A file cannot be unpacked if any of the following occurs:

For example, to unpack the packed files chap1.z and chap2, enter:

unpack chap1.z chap2

This expands the packed files chap1.z and chap2.z, and replaces them with files named chap1 and chap2. Note that you can give the unpack command file names either with or without the .z suffix.

See the unpack command in the AIX Version 4.3 Commands Reference for the exact syntax.

[ Previous | Next | Contents | Glossary | Home | Search ]