zip commands

Zip is the most widely used archive file format that supports lossless data compression.

Facts about zip files:

  • A Zip file is a data container containing one or more compressed files or directories.
  • Compressed (zipped) files take up less disk space and can be transferred from one to another machine more quickly than uncompressed files.
  • Zip files can be easily extracted in Windows, macOS, and Linux using the utilities available for all operating systems.

How to zip files and directories?

$ zip index.zip index.html, index.php

If we want to add multiple files, directories, and subdirectories in the same archive:

$ zip -r index.zip index.html, index.php, index_directory