Zip and Unzip files on Debian, Ubuntu Linux

First up install the zip and unzip packages if you haven’t already!

sudo apt-get install zip
sudo apt-get install unzip


sudo apt-get install zip unzip

If you are Red Hat Linux/Fedora/CentOS Linux user then you can use the yum command to install zip and unzip program as follows:

# yum install zip
# yum install unzip

A few ziping files/directories examples

Creates the archive and puts all the files in the current directory in it in compressed form, type:

zip data *

Note: No need to add .zip extension or suffix as it is added automatically by zip command.
Use the ls command view a current files and verify new zip file:
To zip up an entire directory (including all sub directories), type the following command:

zip -r data *

unzipping files/directories examples

To use unzip to extract all files of the archive into the current directory & sub directories:


You can also test, printing only a summary message indicating whether the archive is OK or not:

unzip -tq

To extract the file called cv.doc from

unzip  cv.doc

To extract all files into the /tmp directory:

unzip  -d /tmp

To list all files from

unzip -l