DevOps Essentials

View on GitHub



unzip - list, test and extract compressed files in a ZIP archive


unzip [-Z] [-cflptTuvz[abjnoqsCDKLMUVWX$/:^]] file[.zip] [file(s) …] [-x xfile(s) …] [-d exdir]


unzip will list, test, or extract files from a ZIP archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into the current directory (and subdirectories below it) all files from the specified ZIP archive.



To unzip to a particular directory

$ unzip /tmp/ -d /tmp;

To use unzip to extract all members of the archive into the current directory and subdirectories below it, creating any subdirectories as necessary:

$ unzip letters

To extract all members of into the current directory only:

unzip -j letters

Here -j option signifies junk paths. The archive’s directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one).