How to extract a zip file to a folder in Linux?

Ads
 
Tutorials   
Ubuntu 22.04 System Requirements How to install Chrome in Ubuntu 22.04 LTS? We are providing Linux CD's for free. How to install Ubuntu 22.04 LTS on Oracle Virtualbox? Ubuntu 22.04 tutorials How to Install VirtualBox in Ubuntu 20.04? How to extract a zip file to a folder in Linux? Installing Sublime 3 Text on the Ubuntu 20.04 operating system Create tar.gz file in Linux command line Download and Install Ubuntu 19.04 on Oracle VirtualBox How to install clang on Ubunut? How to install GParted Partition Manager? yum clear cache PHP MySQL on Centos 5.x Linux Basics Linux Installation Process Hardware Requirement for Linux. Running from CDs Linux Distributions Linux Vs. Windows Linux in Internet Linux as a Command Line Interface (CLI) Vs. Graphics User Interface (GUI). Utility of Linux Significance of Linux What is Linux? Fedora Core 6 Guide, Installing Fedora Core6 Linux Firewall What is Linux? Installing Sun JDK on Linux The Beginners Linux Guide Buy Xandros 2.01 OCE in India from us.Xandros 2.01 OCE is available in India at cheapest rate. Buy SuSe 9.1 Professional CDs in India from us. Suse 9.1 Professional is available with us. Buy SuSe 9.2 Professional CDs in India from us. SuSe 9.2 Professional is available with us. Buy SuSe 9.2 Live CDs in India from us. Suse 9.2 Live is available with us. Buy SuSe 9.1 Personal CDs in India from us. Suse 9.1 Personal is available with us. Buy SuSe 9.1 Live CDs in India from us. Suse 9.1 Live is available with us. We are providing Downloadable Version of Slackware 9.1 Linux CD's. Buy Slackware 10.0 in India from us. Slackware 10.0 is available with us. We are providing Linux CD's for free. Buy Peanut 9.6 Linux in India from us. Peanut 9.6 distribution is available in India.

How to extract a zip file to a folder in Linux?

In this tutorial we will see how to extract a zip file to a folder in Linux?

In this tutorial we will see how to extract a zip file to a folder in Linux?

How to extract a zip file to a folder in Linux? Step by step command with example to extract a zip to specified folder

In this tutorial we are going to explain you the usage of unzip tool in Linux and tell you the command to extract content of a zip file to a specified directory. If you have a zip file and you want to extract to a specified folder instead of extracting to same folder then you can easily use the unzip command of Linux. There are many ways you can use this command to extract a zip file.

This tutorial will explain you how to install unzip utility in your Linux box if its not there and then use the unzip command to extract a zip file to directory of your choice.

What is unzip utility?

The unzip utility is a command line tool for Linux operating system which can be used to unzip a zip file. In Ubuntu operating system you can install it with following command:

sudo apt install unzip

Above command will ask you the admin password and after that it will install unzip tool on your Ubuntu operating system.

If you are using Centos or Redhat Linux then use the following command to install on your system:

sudo yum install unzip

The yum utility will install unzip tool on your system.

How to use unzip tool?

In many different way you can use the unzip tool to unzip your files. Here is the syntax of unzip utility:

unzip file.zip

Above command takes zip file name as parameter and then extracts the content of this file into current directory.

If you want to extract the content of a zip file to a specified directory then you can use -d option. With -d option you can specify the directory where you want to extract the content of file. Here is syntax:

unzip -d /myuser/mydirectory/ file.zip

Above command will extract the content of file.zip into /myuser/mydirectory/. So, extract the content to a specific directory you can use unzip command.

Here is the screen shot of use use of unzip command to extract content to a different directory:

Example of extracting zip file into a directory

Suppose you have a file file.zip and you want to extract the content of this file into a directory called extractdir. Then you can use the following command:

unzip file.zip -d extractdir

You can also provide the complete path of the directory if the directory is in different path than the current directory. Here is example:

unzip file.zip -d /home/user/somedir/extractdir

Here is the screen shot of the unzip example in Ubuntu 18.04:

Unzip example in Linux and Ubuntu

In this tutorial we have learned how to use the unzip tool to zip a file.

Related Linux tutorials:

Ads

Ads