First install the unzip utility if it isn't already installed on your system. But before this, let's begin by updating the local package index by using the following command:
sudo apt update
Now run the following command to install the unzip utility:
sudo apt install unzip
To extract zip file at the same location you can simply use the following command:
unzip filename.zip
If you want to extract zip file to a particular destination folder, you can use the command:
unzip filename.zip -d /path/to/destination_folder
For example, if your current working directory is /var/www and you want to extract /var/www/sample.zip file inside /var/www/dev, you can run:
unzip sample.zip -d dev
Or, if you want to use absolute path you can run the following command.
unzip /var/www/sample.zip -d /var/www/dev
Both commands will have the same effect, because current working directory doesn't matter when you use absolute path. Any path that starts with a forward slash / is an absolute path.
Use the
unzip
CommandFirst install the unzip utility if it isn't already installed on your system. But before this, let's begin by updating the local package index by using the following command:
Now run the following command to install the unzip utility:
To extract zip file at the same location you can simply use the following command:
If you want to extract zip file to a particular destination folder, you can use the command:
For example, if your current working directory is
/var/www
and you want to extract/var/www/sample.zip
file inside/var/www/dev
, you can run:Or, if you want to use absolute path you can run the following command.
Both commands will have the same effect, because current working directory doesn't matter when you use absolute path. Any path that starts with a forward slash
need an explanation for this answer? contact us directly to get an explanation for this answer/
is an absolute path.