The following is the complete tutorials to make zip archive file in Linux.
Why you need zip archive file? It is simply to minimize the original size of the file into the smallest size possible.
How To Install Zip In Linux
The following is the command to install zip on CentOS:
yum install zip -y
The following is the command to install zip on Ubuntu / Debian:
apt install zip -y
How to create zip file or zip file
The following is the command to zip the file:
zip myfile.zip myfile
The following is the command to create zip folder archive:
zip -r myarchive.zip folder
The following is the command to create zip file for multiple files and folders:
zip -r myarchive.zip file1 file2 folder1 folder2
Based on my experiments using both .zip and .tar archive software, I found that that file size produced by .tar is smaller compared with zip, the following is the comparison between the two:
10240oke.tar 171oke.tar.bz2 170oke.tar.gz 814oke.zip
Now continue with how to extract or unzip file in Linux.