Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zip and unzip a directory and its file in linux [closed]

Tags:

linux

zip

unzip

I am a newbie in Linux. Whats is the complete process to zip and unzip a directory and its files? Please mention if any installation has to be done.

like image 832
AB4U Avatar asked Aug 13 '15 07:08

AB4U


People also ask

How do I zip a folder and its contents in Linux?

The easiest way to zip a folder on Linux is to use the “zip” command with the “-r” option and specify the file of your archive as well as the folders to be added to your zip file. You can also specify multiple folders if you want to have multiple directories compressed in your zip file.

Can you zip a directory in Linux?

In Linux, zipping a folder saves a lot of space and network bandwidth. Since its development in 1989, ZIP has become one of the preferred ways to compress data and reduce the file size. Using some native commands like zip, you too can zip a folder on Linux-based systems with ease.

How can we unzip a zip file in Linux?

To unzip files, open File Manager, as explained in the Zipping Files via GUI section. Right click the ZIP package you'd like to extract, and select Extract Here, as shown below. Once you click Extract Here, Linux will extract all files in the ZIP package in the working directory.

How do I open a zip file without unzipping it in Linux?

If you need to check the contents of a compressed text file on Linux, you don't have to uncompress it first. Instead, you can use a zcat or bzcat command to extract and display file contents while leaving the file intact.


1 Answers

To zip a folder and it's contents recursively:

zip -r archivefile foldername

To unzip a zip file:

unzip archivefile
like image 88
flauntster Avatar answered Oct 01 '22 05:10

flauntster