How Do I Zip a Directory and Subdirectories in Linux?
Contents

The easiest way to zip a folder on Linux is to use the “zip” command with the “-r” option and specify the file of your archive as well as the folders to be added to your zip file. You can also specify multiple folders if you want to have multiple directories compressed in your zip file.

Can you zip a folder with subfolders?

To zip a folder containing multiple documents, select the folder you wish to zip, right click and select “compress to… (file name)”. Please note: If the folder you are trying to zip contains subfolders within the main folder, you will need to following instruction below to retain this file structure.

How do I zip multiple folders into a zip file?

With WinRAR, open the Folder that contains the folders you want to zip, then follow these steps:

  1. Select all folders you want zipped/rared.
  2. Click “ADD” or Alt + A or Commands -> “Add files to Archive”
  3. Select RAR or ZIP.
  4. go to “Files” tab.
  5. Check “Put each file to separate archive” under the Archives box.
Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest