How to extract archives with SSH at Hostinger

Extract archives with SSH at Hostinger: unpack .zip, .tar, and .tar.gz files with unzip or tar after connecting to your hosting plan.

Updated 4 days ago

Extract archives with SSH at Hostinger by connecting to your hosting plan, opening the folder that contains the archive, and running unzip or tar. The command depends on the archive format: .zip, .tar, or .tar.gz.

Step 1 – Preparation

Make sure, that your archive is located in the folder, where you expect it to be. If it needs to be uploaded, you can do so with the File Manager or using FTP.

Step 2 – Connection

Enable SSH access and connect to your account using SSH. Open the directory, where your archive is located. For that:

  1. Open your website’s root directory

  2. Run ls command. If you see the needed archive, then you can go to Step 3

  3. If the needed file is in a subdirectory, reach it by running:

cd path/to/files

where “path/to/files” is changed by an actual path to your file. For example, if your archive is located in public_html/new/version1, then the command should be “cd new/version1”.

Step 3 – Extraction

Finally, the extraction. The command will differ based on the archive’s format:

  • ZIP: unzip archive.zip

  • TAR: tar -xvf archive.tar

  • TAR.GZ: tar -zxvf archive.tar.gz

Where instead of “archive” write the name of your archive’s file. Extraction takes some time; as soon as it’s finished, you will see this from the new line:

-bash-4.2$

and have an opportunity to run the new command:

Hostinger SSH terminal showing tar extraction command and extracted PHP files

You can open File Manager to double-check that your archive is already extracted and files waiting for you in a separate folder, named by the archive. To compress files into a new archive, see How to create archives with SSH at Hostinger.