QUICK TIP - Zip and Unzip on Linux with 2 easy WordPress Examples

0 32,317
:1of2
1
2
storage_area_network_with_oracle_zfs_on_centos_linux_l1.jpg | A&H Business Technology
Related posts

Zip and Unzip on Linux – A Zip archive is a compressed file format that supports lossless data compression. A zip archive might contain multiple files and directories inside it. Zip is a very popular archive file format.

Almost every operating system supports zip including all the operating systems by Microsoft as well as all the Linux operating systems.

In this in-depth guide, I will show you how to install zip and unzip on Linux operating systems. We will also learn how to zip and unzip files in Linux.

In order to use Zip and Unzip in Linux, we have to first install Zip and Unzip on Linux operating system. Before we move on to the installation part, make sure you have sudo privilege on your Linux server.

We need sudo privilege to install new software packages on our server. So, If you have sudo privilege, you can continue with the tutorial.

Install Zip and Unzip on Linux(Ubuntu/Debian)

It is very easy to install these utilities on Ubuntu and Debian. Both these operating systems use apt to manage software on the machine.

Execute the following commands to install zip and unzip utilities on Ubuntu/Debian operating systems.

Zip and Unzip on Linux

It will just take 10-20 seconds to install these utilities. Once the process is complete, execute the zip command to verify the installation. You will get list of options and the version of zip as an output.

Install Zip and Unzip on Linux (CentOS)

The “Zip and Unzip on Linux” method will also work for Fedora operating system as both of them use yum to manage software on the machine.

Execute the following commands on your server to install Zip and Unzip on CentOS server.

Once the process is complete, execute the zip command to verify the installation. Once the installation is done, we can move on to learn how to Zip and Unzip on Linux operating systems.

How to Zip on Linux

Zip is a very simple and straightforward utility. Let us first see the syntax of zip command.

Options in zip command allows us to control the execution of the command. Then comes the ZIP_FILE_NAME, we have to replace this with the name of the zip file we want to create, for example, example.zip.

Then, you can list all the files that you want to include in this zip archive.

COMPRESS INDIVIDUAL FILES

For example, Let’s say we have file1.txt and file2.csv that we want to zip. To compress these files inside a zip archive, we have to run the following command.

This command will create a zip archive called files.zip in the current directory.

COMPRESS A DIRECTORY

Now, Let’s say we have a directory called wordpress that we want to compress in a zip archive. To create a zip archive of a directory, we will use the -r option in zip command.

The -r option will make the process recursive, it means that the zip archive will contain every file and subdirectories contained inside the directory we want to compress.

TinyURL for this post: https://tinyurl.com/y3oe2waf

Sorry, The Comment Form Is Temporarily Closed At This Time
:1of2
1
2
1
Next
You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Language:English