How to zip/unzip files/folders on Centos? Print

  • 0

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

Was this answer helpful?

« Back
Sign up for a newsletter

chat