O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

compress — stdin  stdout  - file  -- opt  --help  --version

Synopsis

compress [options] [files]

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 create file. 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required