DEV Community

Cover image for Living in the Shell #8; unzip
Babak K. Shandiz
Babak K. Shandiz

Posted on • Originally published at babakks.github.io on

Living in the Shell #8; unzip

unzip 🎉

Extracts ZIP archive contents.

Test archive integrity -t

unzip -t x.zip
Enter fullscreen mode Exit fullscreen mode

List archive content (short format) -l

unzip -l x.zip
Enter fullscreen mode Exit fullscreen mode

Display exhaustive archive information/content -Zzl

unzip -Zzl x.zip
Enter fullscreen mode Exit fullscreen mode

Extract all files into given path -d

unzip x.zip -d output-dir
Enter fullscreen mode Exit fullscreen mode

Extracts all files into output-dir directory.

Extract specific files

unzip x.zip a.txt b.txt
Enter fullscreen mode Exit fullscreen mode

Extract all, but exclude some files -x

unzip x.zip -x a.txt b.txt
Enter fullscreen mode Exit fullscreen mode

Extracts all but excludes a.txt and b.txt.

Extract with overwrite -o

unzip -o x.zip -d output-dir
Enter fullscreen mode Exit fullscreen mode

Extract without overwrite -n

unzip -n x.zip -d output-dir
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
waylonwalker profile image
Waylon Walker

Nice examples!