Bootstrap FreeKB - Linux Commands - unzip
Linux Commands - unzip

Updated:   |  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 to a directory

The -d option can be used to unzip the contents to a specific directory.

unzip -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 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 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 Buy Me A Coffee


Add a Comment

Please enter 0913bf in the box below so that we can be sure you are a human.