Some simple examples on how to use Zip on the Linux command line.

To compress a single file:
zip apache.log

This will package the file apache.log into a zip file called The original apache.log file will not be deleted by zipping it. If does not exist it will be created in the current working directory. If an archive with this name already exists the file will be added to

To back up a directory you need to add the -r (as in recursive) parameter. To create an archive of the /etc directory in your current working directory:
zip -r /etc

To show the contents of a zip file:
unzip -l

To extract all files in a zip file into the current directory:

If you only want to extract a single file from a zip archive:
unzip filename

You can also specify multiple file names to extract. If you created an archive of the /etc directory in the example above and now want to extract the files hostname and hosts into the current directory:
unzip etc/hostname etc/hosts