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 data.zip

    zip data.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 data.zip
  4. We can run the below command to unzip the files inside zip.

    unzip data.zip

Related Articles

How to use the Rsync command in linux?

Rsync is an important command in Linux and used to synchronize or copy the files and directories...

How to Setup MySQL Master-Slave Replication on RHEL 7?

In MySQL Replication process, one server data is automatically copied to another backup server in...

How to set Automate Tasks on a Linux VPS Using Cron?

One of our Linux VPS customers faced an issue wherein his Virtual Machine’s system clock was...

How to delete mailman archives on cPanel using command?

If you have created a mailman mailing list called [email protected] and want to clear it, then...

How to Safely Change the Location of MySQL/MariaDB Data Directory on cPanel/WHM Servers?

You may require to change the MySQL data directory due to insufficient partition space on /var or...

  • 0 Users Found This Useful

Was this answer helpful?