Linux - Zip files and directories

By xngo on July 8, 2019

In MS Windows, you can zip files or directories by simply right-clicking on selected files or directories. Whereas, in Linux, you have to use the zip utility. In this article, I will show you how to compress files, directories and then unzip them.

Zip files or directories

The general syntax is: zip [options] zipfile files_list.

For example, the following command will compress the whole to-send directory to send.zip file.

zip -r send.zip to-send/

Unzip

To unzip, simply execute zip with the zipfilename. For example,

unzip send.zip

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.