File Compression and Packaging

gzip

Compress files with GNU Zip.

gunzip

Uncompress GNU Zip files.

bzip2

Compress files in BZip format.

bunzip2

Uncompress BZip files.

bzcat

Compress/uncompress BZip files via standard input/output.

compress

Compress files with traditional Unix compression.

uncompress

Uncompress files with traditional Unix compression.

zcat

Compress/uncompress file via standard input/output (gzip or compress).

zip

Compress files in Windows Zip format.

unzip

Uncompress Windows Zip files.

tar

Package multiple files into a single file.

The Terminal has commands to compress files into a variety of formats and uncompress them. The most popular formats are GNU Zip (gzip), whose compressed files are named with the .gz suffix, and BZip, which uses the .bz2 suffix. Other common formats include Zip files from Windows systems (.zip suffix) and occasionally, classic Unix compression (.Z suffix).

If you come across a format we don’t cover, such as Macintosh sit files, Arc, Zoo, rar, and others, you can head over to http://en.wikipedia.org/wiki/List_of_archive_formats to learn more.

Get Macintosh Terminal 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.