Linux Commands - unzip

by
Jeremy Canfield |
Updated: January 26 2022
| Linux Commands articles
The unzip command without any option will extract all of the contents of a zip file to the present working directory.
unzip example.zip
Unzip to a directory
The -d option can be used to unzip the contents to a specific directory.
unzip example.zip -d /path/to/directory
Unzip multiple files
Here is how you can unzip all of the files ending in .zip in the present working directory.
unzip '*.zip'
Permission denied
Let's say you want to unzip the contents of example.zip to the /opt directory, and the /opt directory has the following permissions. In this example, only root has permission to write to the opt directory.
drwxr-xr-x. 16 root root 217 Nov 13 00:45 /opt
If you attempt to unzip example.zip to the /opt directory, and you are not root, something like this will be returned.
checkdir error: cannot create /opt/foo
Permission denied
Did you find this article helpful?
If so, consider buying me a coffee over at