Sometimes we download files from the internet. These files are in archived form because it is done to reduce the file size and give extra protection to the file. There are different types of archived files such as tar.zip, .rar, .7s, and .zip. This article discusses how to unzip the .zip files.  

How to Unzip a Zip File from the Ubuntu Terminal?

To unzip the file from the Ubuntu/Linux terminal first install the “unzip” command on the Linux by using the terminal. Open the Linux terminal using the shortcut key “Ctrl+Shift+T” from the keyboard. Now for the installation execute the command.

sudo apt install unzip

In the above command 

  • sudo” command is used to attain the root rights in the Linux terminal.
  • apt” command is used to access the advanced packages to install and remove files in the Linux terminal.

Now unzip the files by executing the command given below

unzip file name

Now if there are more than one zip files then use the below given command to unzip them

unzip '*.zip'

In the above command “*.zip” check for more than one zip file and unzip them.

Now if you want to unzip the files by excluding the specific then execute the below given command.

unzip file name -x excluded file name

In the above command “-x” is used to specifically exclude the desired file from the unzip folder.

If you want to unzip the file in a different directory then use the command given below

sudo unzip file name -d /path/to/destination

In the above command “-d” is used with “unzip” to extract the files in a different directory.

The unzip the file in the absolute path use the below command

unzip /home/tahir/My_files/Data.zip -d /home/tahir/Documents

In the above command 

  • /home/tahir/My_files” is the path of the file where your zip files lie.
  • /home/tahir/Documents” is the path where you want to unzip your file.

Now install “p7zip” package by executing the below given command

sudo apt-get install p7zip-full

The package p7 is a platform used by both Windows and Linux to archived and unzip the file by high compression. After installation of “p7zip” execute the below given command to unzip the file.

7z x zipfile.zip

To list the data of the zip file blow given command is to be executed 

7z l file name.zip

In the above command “l” is used with “unzip” to list the data of the zip file.

Now install the GUI app from the terminal by executing the below given command

sudo snap install p7zip-desktop

Now open the “p7zip-desktop” app by searching it from the search bar

Now navigate the directory where your zip file lies, and select the file then click on the “Extract” 

After clicking on the Extract a new window opens from this window click on the “OK”. After completing the process your files will be unzip in the desired directory.

Unzip the files from the archive manager

Now reaches the directory where your zip file is located.

Now right-click on the file you want to unzip and click on option “Open With Archive Manager”.

Now click on the “Extract” to unzip the data from the zip file.

Conclusion

To unzip the zip files in Linux/Ubuntu terminal there are different commands used such as “unzip”, “p7zip” package and by installing a GUI app named as “p7zip-Desktop”. Among all these the most important and easy one is by using the “unzip” command. In this method you need to install the unzip package by executing the “sudo apt install unzip”, and then unzip the file by executing the “Unzip file name” command.