Unfortunately the gunzip command will not work here in debian on all .zip files, whereas the unzip command does work. The example used was a .zip file from github of interest here:
Code:
$ gunzip -S .zip minimal-master.zip
gzip: minimal-master.zip has more than one entry -- unchanged
The unzip command works:
Code:
$ unzip minmal-master.zip
Archive: minimal-master.zip
8a6b0777913195de466fb294740292187ad4e5e8
creating: minimal-master/
creating: minimal-master/.github/
<snip>
Ooops! Sorry about that! For some reason, I thought unzip was just a symbolic link to gunzip on Debian…. :/. Looking again, they are completely separate executables.
If I’m completely honest, I’ve been using dtrx (AKA Do The Right Extract) for extracting compressed files in the terminal since 2007/8. Dtrx is a python based CLI tool that can extract virtually any compressed archive formats, as long as you have all of the relevant tools installed for each file-type you want to extract.
The advantage of dtrx is it deals with invoking the appropriate tools for the file-type you’re dealing with. So you don’t have to remember all of the various commands and command-line options for each file-formats toolset.
To use dtrx is as simple as:
Where /path/to/file.ext is the path to a compressed file format.
E.g.
./backup.zip
You can also list different files with different extensions and extract them all in a single operation:
Code:
dtrx ~/Downloads/*.{zip,tar.gz,7z}
Above would extract ALL files in ~/Downloads that have .zip, .tar.gz and .7z extensions. And dtrx will invoke the appropriate tools to decompress/extract each file/archive.
Since starting to use dtrx, I haven’t manually extracted anything for a very long time! :/.
Maybe I should have mentioned dtrx in my first post?!
Gunzip is more for single files, usually used to unzip tar files (tar.gz). For some reason, I thought it worked on standard zip files too! :/
Btw: If anybody is interested, the github for dtrx is here:
Intelligent archive extraction. Contribute to moonpyk/dtrx development by creating an account on GitHub.
github.com