How to Unzip/Zip Files in Linux/Unix using command line?

Want to know how to unzip/Zip the file in Linux from command line?

Unzip/Zip are the extraction and compress tool which is easily available in Unix based OS like Mac OS, Windows, Linux Redhat etc.

Try zip and unzip command in Terminal

If you get following command not found then you need to install the package using

zip: command not found or
unzip: command not found

Linux Debian / Ubuntu

apt-get install zip
apt-get install unzip

Redhat, Fedora, Centos

yum install zip
yum install unzip

How to Zip only one File? i.e Single file

zip techtach.mp3

It will zip techtach.mp3 and name the file as

How to Zip Multiple files or folder?

zip file1.txt file2.mp3 file3.pdf

It will zip all three files and name the file as

zip file1.txt folder1 folder2

It will zip 2 folders and one file in

How to extract zip file using command line?


It will unzip in the current directory.