How Unzip File in Linux from Terminal

Table of Contents
Unzip File in Linux from Terminal
Compressed files are easy to transfer and use in a computer system. Zipping file in Linux is one of the easiest utility. By using zip command you can zip files easily without losing quality. If you want to Unzip this file then you can use unzip
utility in Linux.
Install Unzip Utility
You can install unzip
utility in the following ways:
Unzip on CentOS
sudo yum install unzip
Install Unzip on Ubuntu or Debian
sudo apt install unzip
Unzip on Fedora
sudo dnf install unzip
Unzip on SUSE/OpenSUSE
sudo zypper install unzip
How to Unzip File in Current Directory
Following is the simplest and easier way to unzip a .zip file in Linux without using any options but remember you should have write permission for current directory:
unzip demofile.zip
The above command will unzip demofile.zip
file in the current directory and saves extracted files
How to Unzip File in Specific Directory
You can extract files in a specific directory by using -d
option with unzip command. It is always required to have to write permission for a given specific directory so it is recommended to run it with sudo
.
For example, the following linux4one.com.zip
file will be extracted inside /var/www/html/
directory:
sudo unzip linux4one.com.zip -d /var/www/html/
How to Unzip File with Password
You can also extract password protected zipped files using unzip command. Below is the basic syntax for decompressing password-protected file:
sudo unzip -P PASSWORD file.zip
For example, if you want to unzip demofile.zip with password abc123
then you can do so by using the following command:
sudo unzip -P abc123 demofile.zip
Check The Contents of Zip File Without Extracting
You can check or list all the zip file contents using -l
option with unzip command.
For example to list all the contents of demofile.zip
run below command:
unzip -l demofile.zip
Conclusion
You have successfully learned How Unzip File in Linux from Terminal. If you have any queries please don’t forget to comment out.
LATEST POSTS
-
How to Install Java on Linux Mint 19
-
How to Install Grub Customizer on Ubuntu 18.04 LTS Linux
-
How to install Python on Ubuntu 18.04
-
Copy Files using cp command in Linux
-
How to Install Adobe Flash Player on Ubuntu
-
Bash Functions with Examples
-
How to install Node.js with npm on Debian 9
-
How to Remove Docker Images, Networks, Containers and Volumes
-
How to Install VirtualBox on CentOS 7
-
How to Install MySQL on CentOS 7
-
How to Copy Folder/Directory in Linux
-
How to Install Anaconda on Debian 9