zip

zip [-o] [-a] [-0 to -9] <file name>.zip [files_to_add]

The zip command is a compression utility that enables you to compress one or more files to the .zip file format. The zip command supports the following options:

Option Description

-o

Overwrites an existing .zip file.

-a

Adds files to an existing .zip file.

[-0 to -9]

This value determines the degree of compression applied to the .zip file.

Note: Higher the value, compression is percentage is high and it takes a long time to compress. Lower the value, compression percentage is less and it takes only a short while to compress.

Examples

zip ab.zip a.txt b.txt

This example compresses the a.txt and b.txt files and adds them into the ab.zip file.

zip files.zip files/*

This example compresses all files in the files directory and adds them to the files.zip file.