How to zip/unzip files/folders on Centos?

Zip is a famous archive format and it is used in most operating systems. It is very easy to zip and unzip files or folders on Linux. Please refer to the following steps to zip and unzip files and folders on Centos.

Before referring to the following steps, make sure you have sudo or root privileges on the OS.

  1. First of all, let us install zip on Centos. 

    sudo yum update
    sudo yum install zip unzip -y
  2. Now, let us zip the files that are created in /home directory. We have 3 files lying inside /home directory that are data.sql, data1.sql and data2.sql. We will add these 3 files in a single zip using the below command and newly created named

    zip data.sql data1.sql data2.sql
  3. To verify the created zip has the files that we have compressed in a zip, we can run the below command.

    unzip -l
  4. We can run the below command to unzip the files inside zip.


Related Articles

What is IP forwarding in Linux? How to enable IP forwarding?

IP forwarding helps you to set up the OS to work as a router. You can set IP forwarding when you...

How to parse PHP in html files?

Are you looking to make all the .html pages of your websites to run as .php or you are looking to...

How to kill a process on Linux using command?

There might be an issue with applications that can be hung and not working properly. In this...

Difference Between su and sudo and How to Configure sudo in Linux VPS.

As we know Linux provides much better security. You can set user management policy and user...

How to check Various cPanel logs like WHM, Apache, MySQL, Email, Error etc?

You can use cPanel to access your Linux hosting account with GUI. It is relatively easier to work...

  • 0 Users Found This Useful

Was this answer helpful?