unzip(1)
Extract files from ZIP archives.
Synopsis
unzip [-acdflLmopqtuvVX] [-n|-o|-j] [-P password] [-d exdir] file.zip [file...]Description
unzip lists, tests, or extracts files from a ZIP archive. By default it extracts all files to the current directory, preserving paths and permissions. It handles standard ZIP format compression including deflate, store, and other methods.
Without options, unzip extracts silently. Use -l to list contents or -t to test integrity without extracting. Passwords are supported for encrypted archives.
Common options
| Flag | What it does |
|---|---|
-l | List archive contents (filenames, sizes, dates) |
-t | Test archive integrity without extracting |
-v | Verbose: show detailed information during extraction |
-q | Quiet: suppress all messages except errors |
-d exdir | Extract into directory exdir instead of current directory |
-o | Overwrite existing files without prompting |
-n | Never overwrite existing files; skip them |
-P password | Use password to decrypt encrypted archive |
-j | Junk paths: discard directory structure, extract to single directory |
-a | Convert text files to native line endings (LF/CRLF) |
-L | Convert filenames to lowercase |
-p | Extract to stdout instead of writing files |
Examples
Extract all files from archive.zip to current directory
unzip archive.zipList all files in archive.zip without extracting
unzip -l archive.zipExtract archive.zip into /tmp directory
unzip -d /tmp archive.zipQuietly extract, overwriting existing files without prompting
unzip -q -o archive.zipTest archive.zip for corruption
unzip -t archive.zipExtract encrypted archive using password to output directory
unzip -P mypass -d output archive.zipExtract all files ignoring directory structure into flat/ directory
unzip -j archive.zip -d flat/Extract only specific files from archive
unzip archive.zip file1.txt file2.txt