FreeKB - Linux Commands unzip
Linux Commands - unzip

The unzip command without any option will extract all of the contents of a zip file to the present working directory.

~]# unzip


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


Unzip to a directory

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

~]# unzip -d /path/to/directory


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

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


Web design by yours truely - me, myself, and I   |   |