How to unzip file on Ubuntu Linux

When downloading files from Internet you will often get an archive. The purpose of archive among many is to reduce download size, reduce number of files being downloaded to just one, provide basic integrity check on the subject files and sometimes provide additional security with the use of passwords. There are many archive types most commonly used of them are .zip, .rar. .7z, .tar.gz. Today we are going to speak about .zip archives. On Windows there exist GUI archivers like WinRAR or WinZip which are able to deal with most of the common archive types.

But what can you do whent you just downloaded zip file on Ubuntu Linux and have just a console? This can happen when you have installed Ubuntu Server or working from a Terminal Program.

So, first of all you need to install unzip package. To do so, type in a terminal: 

sudo apt-get install unzip

 

You may be requested admin password and to confirm if you with Ubuntu to occupy additional disk space with programs. Enter password and answer yes when needed. After all the packets have been installed. Type in a terminal:

unzip archive.zip 

Will exrtact the archive file.zip residing in the current directory placing it's contents to the current directory

 

If you want to extract the file to another directiory, type: 

unzip file.zip -d destination_folder

 

for example:

unzip mysite.zip -d /var/www

will extract the contents of the archive mysite.zip to the folder /var/www

 

Sources:

inux.die.net

askubuntu.com

 

Add comment

Security code
Refresh