zip

>Usage

zip is a powerful tool that compresses different file types.

>Synopsis

zip [options] file_name.zip files_names

>Options

-d

remove (-d): This option allows you to remove specific files from a zip archive.

Example 1:

Dots

-zsh

zip -d archive.zip file1.txt


we are deleting file file.txt from the zip archive archive.zip

-u

update (-u): is used to update files in an existing zip archive.

Example 2:

Dots

-zsh

zip -u archive.zip file.txt


we are updating the file file.txt in the zip archive archive.zip with its most up to date version.

-e

encrypt (-e): is used to encrypt the contents of the archive with a password.

Example 3:

Dots

-zsh

zip -e archive.zip file1.txt


we are encrypting the file file1.txt inside of the zip archive archive.zip

-x

exclude (-x): is used to exclude specific files from being included in the zip archive.

Example 4:

Dots

-zsh

zip archive.zip * -x file2.txt


we are exluding from the zip archive archive.zip the file file2.txt

-m

move (-m): is used to move specified files into the zip archive.

Example 5:

Dots

-zsh

zip -m archive.zip file3.txt


we are moving the file file3.txt to the zip archive archive.zip

-r

recursively (-r): is used to recursively zip a directory and its files.

Example 6:

Dots

-zsh

zip -r archive.zip dir


we are allowed to recursively zip the directory dir inside the zip archive archive.zip

-0 to -9

compression quality (-0 to -9): is used to choose the quality of compression to compress a file with. Lower levels (-1 to -5): Faster compression, larger file sizes Middle levels (-6 to -7): Balanced compression, moderate file sizes Higher levels (-8 to -9): Slower compression, smaller file sizes.

Example 6:

Dots

-zsh

zip -9 archive.zip file.txt


we are compressing with the maximum level of compression the file file.txt inside of the zip archive archive.zip

>Quiz

Progress: Question ? out of ?

Question Title

Page written by Emanuele Bono