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?

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:

Tutorials

  1. Beginner Guide to Linux Server
  2. Beginner Guide to Linux Server
  3. Roseindia.net Place to Get Cheap Linux cds in India!!
  4. RoseIndia.net Is Your On-Line Linux & xBSD CD Distribution Source
  5. RoseIndia.net Is Your On-Line Linux & xBSD CD Distribution Source
  6. We are providing Downloadable Version of Dyne:bolic 1.3 Linux
  7. We are providing Fedora Cord 2 Linux CD's .
  8. Buy Fedora Core 3 Linux CD's in India.
  9. Buy Fedora Core 3 Test 1 Linux CD's in India.
  10. We are providing Linux CD's for free.
  11. Free Linux Distribution in India
  12. We are providing Free BSD 5.3 CD's
  13. We are providing Downloadable Version of Gentoo Linux
  14. Linux Tutorials
  15. We are providing Downloadable Version of K12LTSP Linux
  16. We are providing Downloadable Version of K12LTSP Linux
  17. We are providing Knoppix 3.4 Live Linux CD's
  18. We are providing Knoppix 3.6 Live Linux CD's
  19. We are providing Knoppix 3.7 Live Linux CD's
  20. We are providing Linux CD's for free.
  21. Buy KANOTIX BUG HUNTER 09-2004-A Live CDs in India from us. KANOTIX BUG HUNTER 09-2004-A Live is available with us.
  22. We are providing Downloadable Version of Mandrake 10.1 Community Edition Linux CD's.
  23. We are providing Downloadable Version of Mandrake 10.1 Official Edition Linux CD's.
  24. We are providing Downloadable Version of Mandrake 10.1 Power Pack Linux CD's.
  25. We are providing Linux CD's for free.
  26. We are providing Linux CD's for free.
  27. We are providing Downloadable Version of Mandrake Move Linux
  28. We are providing Downloadable Version of Mandrake Official 10 Linux CD's.
  29. TheOpenCD is a collection of high quality Free and Open Source Software
  30. Buy Peanut 9.6 Linux in India from us. Peanut 9.6 distribution is available in India.
  31. We are providing Linux CD's for free.
  32. Buy Slackware 10.0 in India from us. Slackware 10.0 is available with us.
  33. We are providing Downloadable Version of Slackware 9.1 Linux CD's.
  34. Buy SuSe 9.1 Live CDs in India from us. Suse 9.1 Live is available with us.
  35. Buy SuSe 9.1 Personal CDs in India from us. Suse 9.1 Personal is available with us.
  36. Buy SuSe 9.2 Live CDs in India from us. Suse 9.2 Live is available with us.
  37. Buy SuSe 9.2 Professional CDs in India from us. SuSe 9.2 Professional is available with us.
  38. Buy SuSe 9.1 Professional CDs in India from us. Suse 9.1 Professional is available with us.
  39. Buy Xandros 2.01 OCE in India from us.Xandros 2.01 OCE is available in India at cheapest rate.
  40. The Beginners Linux Guide