Just downloaded a .zip file from the internet. I want to use the terminal to unzip the file. What is the correct way to do this?
|
If the
After installing the unzip utility, if you want to extract to a particular destination folder, you can use:
|
|||||||||||||||||||||
|
|
Here is the command in case you want to extract in present directory
if you want to extract to a particular destination folder, you can use
if there a password you can also use
If the unzip package isn't already installed on your system, then run:
|
|||||
|
|
You can use:
to extract to If you want to extract to an absolute path, use
|
||||
|
|
|
First of all you need to install
1 - If the File is in the same directory that the terminal is and you want to extract it in the same location.
if the file is protected with password use :
ans make sure it's 2 - If the file is not in the same directory and you want to extract it in different directory the the terminal is . use :
if you didn't use And if there a password you can also use |
|||||||||||||||||||||
|
|
I prefer
However for zipping,
and want this in the zip file:
This is easy with
zip does not have the |
||||
|
|
|
Here is the detailed description of options that I find useful:
|
||||
|
|
Using scripting tools: Perl and PythonMany answers here mention tools that require installation, but nobody has mentioned that two of Ubuntu's scripting languages, Perl and Python, already come with all the necessary modules that allow you to unzip a zip archive, which means you don't need to install anything else. Just use either of the two scripts presented below to do the job. They're fairly short and can even be condensed to a one-liner command if we wanted to. Python
Usage:
Perl
Usage:
|
|||
|
|
|
You can simply use Install it: And use it: |
||||
|
|
|
A more useful tool is This command installs
This command lists the contents of the zip:
This command extracts the contents of the zip:
|
|||||||||||||||||||||
|
|
In case your destination is same as the source zip file, you can simply do:
|
|||||
|
protected by Eric Carvalho Sep 30 '15 at 12:07
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
\*as literal star symbol. Just useunzip *.zipto make shell expand*to all files ending in.zip– Sergiy Kolodyazhnyy Jun 2 '17 at 21:55