Menu

Zipping and Unzipping using Terminal

February 7, 2020 - Server
Zipping and Unzipping using Terminal

In order to “unzip” a file using terminal, make sure you have the application installed on your system.

Zipping files using the terminal

Installing zip Application

To install “zip” on CentOS issue the following command in your terminal

sudo yum install zip

To install “zip” on Ubuntu issue the following command in your terminal –

sudo apt-get install zip

Using the zip Application

Now if you want to simply zip a file/folder, you can use the following command –

zip -r zippedFileName.zip foldertozip

Unzipping files using the terminal

Installing unzip Application

To install “unzip” on CentOS issue the following command in your terminal

sudo yum install unzip

To install “unzip” on Ubuntu issue the following command in your terminal –

sudo apt-get install unzip

Using the unzip Application

Now if you want to extract a file to a particular destination folder, you can use the following command –

unzip filetounzip.zip -d path_to_destination_folder

If you want to extract the file in its current location then you can issue the following command –

unzip filetounzip.zip

Leave a Reply

Your email address will not be published. Required fields are marked *