unzip flags & options

Basic extraction

Extract all files from a ZIP archive.

unzip archive.zip

-d

Extract to a specific directory.

unzip archive.zip -d /tmp/output

-l

List contents without extracting.

unzip -l archive.zip

-o

Overwrite existing files without prompting.

unzip -o archive.zip

-n

Never overwrite existing files.

unzip -n archive.zip

-q

Quiet mode — suppress output.

unzip -q archive.zip

-p

Extract to stdout (pipe mode). Useful for reading a single file.

unzip -p archive.zip config.json

-x

Exclude specific files from extraction.

unzip archive.zip -x "*.log" "*.tmp"

Extract specific files

List specific files to extract after the archive name.

unzip archive.zip readme.txt src/main.py

-j

Junk paths — extract all files into the current directory, ignoring archive directory structure.

unzip -j archive.zip