Zip is a compression method and utility program in Linux. You can compress single files and folders with it. This tutorial is about to zip an entire folder recursively.
Let’s assume that your folder you want to compress is named myfolder. In Linux terminal, type:
$ zip -r myfolder.zip myfolder/
This will create a zip file myfolder.zip in the same folder. The argument
-r stands for recursive compression, so each subfolder is included.
Note! also the
myfolder is included, not only its content, so when you unzip the file, it will create a folder
myfolder in the current working directory. Read how to unzip: Unzip File in Linux.
To see contents of a zip file, check this article: See List of Files in Zip in Linux.