Extract a zip archive with unzip
Unpack .zip files from the terminal — the format Windows and macOS send you every day.
Run unzip archive.zip -d ./target-dir to extract into a folder, or unzip -l archive.zip to list contents first.
01Command
Command
$ unzip photos.zip -d ./photos && unzip -l archive.zip02What it does
unzip is the standard extractor for zip files received from other operating systems. -d sends the files to a specific directory (created if needed); without it, files land in the current directory. unzip -l lists what's inside, and -t tests the archive for corruption without writing anything.
03Risk
!Warning: unzip overwrites same-named files in the target directory without asking (it prompts only when the locale encoding mismatches filenames). Extract into a fresh -d folder when unsure. Note: zip filenames are not always UTF-8 — Chinese names from Windows zips may look garbled; use unzip -O gbk on Debian/Ubuntu to fix encoding.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- unzip(1) — list, test and extract compressed files in a ZIP archiveEvidence: unzip extracts ZIP archives; -d chooses the destination directory and -l lists contents without extracting.
Last verified: 2026-09-18 · Category: Files & Folders