B2B Marketing Insights by Ironpaper

SSH help: Unzip a directory on a remote server

Written by Ironpaper | May 25, 2011

Let's say you built a website locally and need to upload the whole thing to a remote UNIX / Linux server, but your site is quite large with numerous files, which would take a while to upload. Also, sometimes uploading a copy of a website can be tricky if you miss a file and forget to check the log--your site could have problems.

One solution is to use SSH to unzip your whole directory on the remote server--it is quick and easy. It can cut your time down significantly and ensure an easy-breezy transfer.

First, zip all the files that you wish to upload to the server, and go ahead and use FTP to upload the files to the proper directory. Then enter the terminal and login to using SSH. Not all hosting accounts will allow SSH, so you may need to check with your particular server to ensure they allow it.

Your login command will look something like this:

ssh user@host

After "ssh" you will need to join your username to your host with "@" like above.

Then locate where you are by using the command "ls", which will list all directories below your entry point. You can then change directories by "cd" like so: "cd my-directory-name".

Once you find your ZIP file that you previously uploaded, you can unzip it quite easily by the following command:

unzip myfile.zip

Enjoy.