Cross-platform file compression

Command Line – zip

© Photo by Alexander Ross on Unsplash

© Photo by Alexander Ross on Unsplash

Article from Issue 231/2020
Author(s):

If you use file compression regularly, zip belongs in your Linux toolbox.

File compression in Linux is usually handled by the native commands tar, gzip, or bzip2. However, an additional alternative is zip [1], a popular cross-platform command supported by a variety of scripts and utilities. If you are dealing with someone using another operating system, zip is often the ideal choice among these compression tools.

Admittedly, on Linux, zip has fallen out of favor, because for a time it did not support 64-bit computing and could not handle files large than 2MB. Today, though, zip, gzip, and bzip2 are broadly similar in functionality and structure. All three have similar options, although not always the same name for every option. All three, too, have a history of providing alternate command names for some functions, such as unzip and ungzip, that duplicate standard options – presumably to make the commands easier to remember.

Despite these similarities, neither zip nor gzip recognizes the other's extensions, although both can use files created by the other if the extension is changed. zip can use the option --bzip to use bzip options, which can produce somewhat better compression rates, at least in theory, on binary files.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: gzip, bzip2, tar

    A short command is all it takes to pack your data or extract it from an archive.

  • Command Line: Archives

    Gzip and bzip2 not only compress files, they also provide lean and powerful tools for viewing, searching, and comparing text files.

  • Command Line – zstd

    In an effort to meet modern computing needs, zstd offers a greater degree of compression at a faster compression rate, with unique options to enhance performance.

  • Graphical Archiving Tools

    Linux supports a number of easy graphical tools for saving data to compressed archives.

  • PeaZip

    Compression tools are part of any user's regular toolkit. PeaZip not only supports exotic formats, it also contributes toward the security and integrity of your data through many additional functions.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News