Sep.01

How to Unzip and Zip folder via SSH

Step 1.
Open Putty or Terminal then login to your server via SSH

Step 2.
Once you are logged into your server via SSH, now navigate to the directory where the .zip file you wish to unzip is located there.

 

Step 3.
Then type following command to try unzipping

unzip [filename].zip

example

unzip screenshot.zip

you may be successful but you may not.

error message:
– bash: unzip: command not found

In this case you have to install it first.

Step 4.
Use following command:

for Debian and Ubuntu:

apt-get install unzip

for Red Hat Linux/Fedora/CentOS users:

yum install unzip

Step 5.
That’s it. Now you can try unzipping it again using command in step 3 above.

example-zip-4-sukses-uznip

 

How to zip / compress file?

Step 1.
Open Putty or Terminal then login to your server via SSH

Step 2.
Once you are logged into your server via SSH, now navigate to the directory where the files and folders you wish to zip / compress are located there.

Step 3.
Use following command:

zip [zip file name] [file 1] [file 2] [file 3] [file and so on]example:

zip example.zip 1.txt 2.txt 3.txt

In this example we’ll compress files 1.txt, 2.txt and 3.txt into a single example.zip file

example zip

you may be successful but you may not.

error message:
– bash: zip: command not found

In this case you have to install it first.

Step 4.
Use following command to install zip function:

for Debian and Ubuntu:

apt-get install zip

for Red Hat Linux/Fedora/CentOS users:

yum install zip

install zip

Step 5.
That’s it. Now you can try zipping it again using command in step 3 above.

Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment