How to unzip a zip file from the Terminal?
If the unzip
command isn't already installed on your system, then run:
sudo apt-get install unzip
After installing the unzip utility, if you want to extract to a particular destination folder, you can use:
unzip file.zip -d destination_folder
If the source and destination directories are the same, you can simply do:
unzip file.zip
You can simply use unzip
.
Install it:
apt-get install unzip
And use it:
cd /path/to/file
unzip file.zip
A more useful tool is 7z
, which zips and unzips a range of compression formats, notably lzma
, usually the protocol offering the highest compression rates.
This command installs 7z
:
sudo apt-get install p7zip-full
This command lists the contents of the zip:
7z l zipfile.zip
This command extracts the contents of the zip:
7z x zipfile.zip