How to compress or extract a file


  • dApplies to: Grid
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: File Manager access, SSH access
  • Applies to: DV
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: File Manager access, SSH access
  • Applies to: Managed WordPress
    • Difficulty: Medium
    • Time Needed: 10
    • Tools Required: SSH access

Overview

The following article contains instructions on a few common ways a file can be compressed and extracted through a variety of means.

File Manager

Please note, this method applies to the Grid Personal, Pro, and Elite.
For (gs) Grid Service or Grid Lite users please refer to one of the alternate methods.

Compress

1. Log into the Media Temple Account Center.
2. Click on the Admin button next to your Grid server.

gs_comp1.png

3. Click on File Manager.

gs_comp2.png

4. Navigate to your desired folder or file. Hovering your cursor over the folder/file will prompt some icons to appear.
5. Click on the gs_comp3.2.png icon.

gs_comp3.png

6. A .zip version of your folder/file will be prompted for download to your computer. A .zip file will also be left on your server.

gs_comp4.png

Extract

1. Navigate to your compressed file in the File Manager.
2. Hovering your cursor over the file will prompt some icons to appear.
3. Click on the gs_ext2.png icon.

gs_ext1.png

4. The compressed folder/file should appear on your server.

gs_ext3.png

Note:
The Grid File Manager is not intended for large compression/extraction. If you run into issue compressing or extracting your files through the File Manager, a likely culprit is the size. In such cases it may be necessary to use the alternative methods below.

SSH

Compress

1. Connect to your server via SSH.

Note:
If you require a refresher on connecting to your server or using SSH commands, feel free to refer to our guides below:

2. Use the cd command to navigate to your desired directory.
3. Use the zip command to compress your desired file/folder.

zip -r archive_name.zip folder_to_compress

Example:

zip -r html.zip html

4. You can use the ls command to check and see your compressed zip file.

gs_ssh2.png

Extract

1. Connect to your server via SSH.
2. Use the cd command to navigate to your desired directory.
3. Use the unzip command to extract your desired file.

unzip archive_name.zip

Example:

unzip html.zip

4. You can use the ls command to check and see your extracted file.

gs_ssh5.png

FTP

FTP clients typically do not come with an compress/extract feature. If FTP is needed, you will want to use the compress/extract feature built-into your computer's operating system, or seek third-party programs.

File Manager

Plesk

Compress

1. Log into the Plesk control panel of your domain.

plesk1.png

2. Click on the File Manager Icon

plesk2.png

3. Navigate to your desired file.
4. Select your file/folder. Then click on Add to Archive.

miss_plesk1.png

3. A pop-up menu should appear. Enter the desired name for your compressed file. Then click OK.
 
miss_plesk3.png
4. A notification should appear to inform you when the file is successfully compressed. You should also see the file now in the File Manager.
miss_plesk4.png

Extract

1. Navigate to your desired file in the File Manager.
2. Select your file. Then click on the Extract Files button.

filemng.png

3. You will be prompted with a pop up message. Click OK.

plesk4.png

  • If you already have an existing file/folder with the same name as your archived file, you can select the Replace existing files option to automatically replace the current file/folder with the data you're about to extract.

4. Once the file is extracted, you will see it appear in your File Manager.

plesk5.png

cPanel

Compress

1. Log into your cPanel account.

cpanel1.png

2. Click on the File Manager icon.

cpanel2.png

3. Navigate to your desired file/folder.

4. Select the desired file. Click on Compress.

cpanel3.png

5. Enter the file type, file path, and name of your file. Then click Compress File(s).

cpanel4.png

6. A pop-up window for the compression results should appear. Click on Close.

cpanel5.png

7. The compressed file should now appear in your File Manager.

cpanel6.png

Extract

1. Navigate to your desired file in the File Manager
2. Select your file. Then click on Extract.

replace_cpanel1.png

3. Enter the file path you wish the extracted files to go. Then select Extract File(s).

cpanel9.png

4. A pop-up of the Extraction Results should appear. Click Close.

cpanel10.png

5. The extracted files should now appear in the File Manager.

cpanel6.png

SSH

Compress

1. Connect to your server via SSH.

Note:
If you require a refresher on connecting to your server or using SSH commands, feel free to refer to our guides below:

2. Use the cd command to navigate to your desired directory.
3. Use the zip command to compress your desired file/folder.

zip -r archive_name.zip folder_to_compress

Example:

zip -r httpdocs.zip httpdocs

4. You can use the ls command to check and see your compressed zip file.

ssh_p2.png

Extract

1. Connect to your server via SSH.
2. Use the cd command to navigate to your desired directory.
3. Use the unzip command to extract your desired file.

unzip archive_name.zip

Example:

unzip httpdocs.zip

4. You can use the ls command to check and see your extracted file.

ssh_p4.png


FTP

FTP clients typically do not come with an compress/extract feature. If you need to use FTP then you will want to use the compress/extract feature built-into your computer's operating system, or seek third-party programs.

SSH

Compress

1. Connect to your server via SSH.

Note:
If you require a refresher on connecting to your server or using SSH commands, feel free to refer to our guides below:

2. Use the cd command to navigate to your desired directory.
3. Use the tar command to compress the desired file.

tar -cvf filename.tar file_to_archive

Example:

tar -cvf mttest.tar mttest

4. You can use the ls command to view your compressed file.

ssh2.png

Extract

1. Connect to your server via SSH
2. Use the cd command to navigate to your desired directory.
3. Use the tar command to extract the desired file:

tar -xvf filename.tar

Example:

tar -xvf mttest.tar

4. You can use the ls command to view your extracted file.

ssh4.png

FTP

FTP clients typically do not come with an compress/extract feature. If FTP is needed, you will want to use the compress/extract feature built-into your computer's operating system, or seek third-party programs.