commands
unzip — inspect and extract ZIP archives
Info-ZIP lists with -l, tests with -t and extracts by default. -d sets destination; -Z -1 lists member names. Only extract trusted archives into a new private directory. Test mode does not authenticate origin. Example assumes a fresh archive lab fixture with new output names.
Formal Syntax & Structure
linux syntaxlinux
unzip [-q] [-l|-t] ARCHIVE [MEMBER...] [-d DIRECTORY]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -l | option | List members without extracting. |
| -t | option | Test compressed member integrity without extracting. |
| -d | option | Takes an extraction directory; omit for current directory. Use a new private directory. |
| -q | option | quiet |
| ARCHIVE | operand | ZIP file |
| MEMBER | operand | Optional member selection; omit to process all members. |
Return Value
exit status and output
Info-ZIP lists with -l, tests with -t and extracts by default. -d sets destination; -Z -1 lists member names. Only extract trusted archives into a new private directory. Test mode does not authenticate origin.
Working Example
Example Snippetlinux
zip -q bundle.zip notes.txtunzip -tq bundle.zip >/dev/null && mkdir out && unzip -q bundle.zip -d out && cmp notes.txt out/notes.txt && printf "restored\n"