LinuxCommandLibrary

unzip

TLDR

Extract files to current directory

$ unzip [archive.zip]
copy
Extract to specific directory
$ unzip [archive.zip] -d [/path/to/directory]
copy
List contents without extracting
$ unzip -l [archive.zip]
copy
Extract specific files
$ unzip [archive.zip] [file1.txt] [file2.txt]
copy
Extract with pattern
$ unzip [archive.zip] "*.txt"
copy
Extract quietly (minimal output)
$ unzip -q [archive.zip]
copy
Extract and overwrite existing files
$ unzip -o [archive.zip]
copy
Test archive integrity
$ unzip -t [archive.zip]
copy
Extract preserving directory structure
$ unzip [archive.zip]
copy

SYNOPSIS

unzip [options] file[.zip] [file(s)] [-x xfile(s)] [-d exdir]

DESCRIPTION

unzip extracts files from ZIP archives. It handles archives created by zip, WinZip, PKZIP, and other ZIP-compatible programs. The tool supports various compression methods and can handle encrypted archives.
By default, unzip extracts all files to the current directory, preserving the directory structure stored in the archive. Individual files or patterns can be specified for selective extraction.
unzip is part of the InfoZip project and is the standard ZIP extraction tool on Unix-like systems.

PARAMETERS

-l

List archive contents.
-v
Verbose listing with compression info.
-t
Test archive integrity.
-d dir
Extract to specified directory.
-o
Overwrite existing files without prompt.
-n
Never overwrite existing files.
-q
Quiet mode.
-qq
Very quiet mode.
-j
Junk paths (don't make directories).
-p
Extract to stdout (pipe).
-P password
Use password for encrypted files.
-x files
Exclude specified files.
-C
Case-insensitive matching.
-a
Convert text file line endings.

CAVEATS

Password on command line is insecure (visible in process list). Large archives with many files may be slow to extract. Some ZIP features (ZIP64, certain compression methods) require recent versions. Symlinks in archives may pose security risks.

HISTORY

unzip is part of Info-ZIP, a project started in 1989 to provide free ZIP utilities. The tools were created by Mark Adler, Jean-loup Gailly, Greg Roelofs, and others to provide open-source alternatives to PKWARE's PKZIP. Info-ZIP utilities became the standard ZIP tools on Unix systems.

SEE ALSO

zip(1), tar(1), gzip(1), 7z(1)

> TERMINAL_GEAR

Curated for the Linux community

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00