Name

compress [options] [files] — ncompress

Synopsis

/usr/bin stdin stdout - file -- opt --help --version

compress and uncompress compress and uncompress files in standard Unix compression format (Lempel Ziv). Compressed files have the suffix .Z.

Sample commands

compress file

Compress file to create file.Z. Original file is deleted.

compress -c file

Produce compressed data on standard output.

cat file | compress

Produce compressed data from a pipeline.

uncompress file.Z

Uncompress file.Z to createfile. Original file.Z is deleted.

uncompress -c file.Z

Uncompress the data on standard output.

cat file.Z | uncompress

Uncompress the data from a pipeline.

zcat file.Z

Uncompress the data on standard output.

Compressed tar files: sample commands

tar cZf myfile.tar.Z dirname

Pack directory dirname.

tar tZf myfile.tar.Z

List contents.

tar xZf myfile.tar.Z

Unpack.

Add the v option to tar to print filenames as they are processed.

Get Linux Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.