•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

How To ZIp A Directory In Linux?

  • Home
  • Client
  • Qa Forum
  • How To ZIp A Directory In Linux?

Posted By: David | 1 Replies | Last Reply On: Nov 09, 2021 12:22:50

I want to zip the folder on my Linux server.  How do I go about it? 

Psychz - Jessica

Votes: 0Posted On: Nov 09, 2021 12:22:50
 

ZIP is a highly useful archive file format that helps in storage and file management. It can save a lot of lot of space and network bandwidth. With an efficient zipping utility, you can compress and store files on your drive or share multiple files and folders by combining them into one single file.

Before we learn how to zip a file/files (multiple) or directories, let us see how to install it on the system. Most of the time, you won't find the zip utility installed on your Linux system by default.

To install zip, you can use your distribution's default package manager.

Ubuntu and Debian:

# apt install zip

CentOS and Fedora

# yum install zip

Let us now see how to compress file/files or directory/directories using ZIP tool.

Use the 'zip' command followed by the name you want to give to the zip file followed by the name of the file you want to zip.

# zip my_zip_file.zip filename1

The output will generate a compressed file by the name 'my_zip_file.zip' which will hold information of file 'filename1'. 

Note: In the above example, if the my_zip_file name doesn’t end with .zip, the extension is added automatically.

 

To zip one or more files, specify the files you want to add to the archive separated by space, as shown below:

# zip my_zip_file.zip filename1 filename2 filename3

The above command will combine and compress all the three files 'filename1 filename2 filename3' into one zip file 'my_zip_file.zip'.

Often, you’ll create a zip archive of a directory including the content of subdirectories. The '-r' option allows you to traverse the whole directory structure recursively:

# zip -r my_directory.zip directory_name

You can also add multiple files and directories in the same archive:

# zip -r my_directory.zip directory_name1 directory_name2 file1 file1

 

Zip utility is pretty simple to use and can be used using GUI as well. We hope that you find the information above helpful.

Was this reply helpful?

Related topics

  • Basic and useful Linux commands
  • Linux Command for Find Directory
  • How to setup a Dedicated Server for Terraria
  • How to setup a dedicated server for Unturned
  • How to setup a dedicated server for Factorio
  • Linux Dedicated Server Hosting
  • Linux & Windows Dedicated Solutions
  • How to setup a Dedicated server for Killing Floor 2
  • How to setup a Dedicated server for Risk of Rain 2
  • Linux Dedicated Hosting
  • How to install Nagios on linux step by step?
  • Best Open Source Cloning Software
  • Previewing The Release Of Windows Server 10
  • Top Five Open Source Backup Software for Linux
  • EasyApache 4: better than ever?
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801