unzip Command: Tutorial & Examples

Decompress files

The unzip command is used to extract files from a ZIP archive. The basic syntax for the command is:

unzip archive.zip

This will extract the files in the archive.zip file into the current directory. You can also specify a different directory to extract the files to using the -d option:

unzip archive.zip -d /path/to/directory

You can also list the contents of a ZIP file without extracting it using the -l option:

unzip -l archive.zip

Other options include the -q option for quiet mode and the -o option to overwrite existing files without prompting.

unzip -oq archive.zip -d /path/to/directory

It is also worth mentioning that in some distribution of Linux you may need to use apt install unzip to install unzip package if not already installed.

Except where otherwise noted, content on this site is licensed under a CC BY-SA 4.0 license CC BY SA