Search notes:

Shell command: unzip

Specify destination directory

By default, unzip extracts the zipped files to the current directory. With -d, a specific directory can be specified:
unzip -d /home/rene/xyz  xyz.zip

Show a zip file's content

unzip -l xyz.zip

Merge the content of zip file into an already existing directory

-o forces overwriting of potentially already existing files.
unzip -o -d /home/rene/xyz  xyz.zip

Extract a given file or directory only

The following command extracts three.min.js (found in the archive under three.js-master/build/) to the «local» directory libraries.
$ unzip -j ~/Downloads/three.js-master.zip three.js-master/build/three.min.js -d libraries
The following command extracts the files found under the archive's pdf directory only.
unzip xyz.zip 'pdf/*' -d ~/dest
Note: the -j option (junk paths which is supposed to not create directories) still creates the pdf directory!

See also

Shell commands (such as zip)

Index