•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  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
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • 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
  • Linux Dedicated Server Hosting
  • Linux & Windows Dedicated Solutions
  • How to setup a dedicated server for Factorio
  • Top Five Open Source Backup Software for Linux
  • Linux Continuous Backup
  • How to change root password in linux?
  • How to setup a Dedicated server for Killing Floor 2
  • Best Open Source Cloning Software
  • How to setup a Dedicated server for Risk of Rain 2
  • Previewing The Release Of Windows Server 10
  • Top Useful Features Of Linux Mint
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company