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.
Further Reading
- Compression Algorithms for Real Programmers by Peter Wayner (partner link)
- Data Compression: The Complete Reference by D. Salomon (partner link)
- Handbook of Data Compression by D. Salomon, Giovanni Motta, D. Bryant (partner link)
- Introduction to Data Compression by Khalid Sayood (partner link)
- Compression & Encryption by D. James Benton (partner link)
- Understanding Compression by Colt McAnlis, Aleks Haecky (partner link)
- Managing Gigabytes by Ian H. Witten, Alistair Moffat, Timothy C. Bell (partner link)
As an Amazon Associate, I earn from qualifying purchases.