Create Zip File From Folder Recursively in Linux

Last updated on Dec 28, 2019 in Linux

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/

This will create a zip file 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.