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 example.zip

 

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

 


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

 



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.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |