This guide will go through how to compress files and directories via File Manager in cPanel.
1. Log into your cPanel account.
2. Browse to cPanel >> File Manager and navigate to the folder used to store the files you want to compress. In this example, we'll use the public_html/Downloads folder seen in the upper left corner of the image below:
3. Highlight every file you want to compress.
A. MacOS users can use the "command ⌘" key combination to highlight multiple files at the same time.
B. Windows and Linux users can use the "ctrl" key to highlight multiple files at the same time.
4. Verify every file to be compressed is highlighted, and click on the "Compress" link in the top right corner as seen in the image below:
5. Choose your desired archive type and click the Compress File(s) button seen in the image below:
6. File Manager will present you with Compression Results upon the compression of your files. Here's an example of how this will look:
7. Confirm all of your selected files were compressed, close the window, highlight the newly created archive, and download it using the Download link seen in the image below:
Using File Manager to Upload and Extract Compressed Files
1. Use one of the methods below if need to compress files(s) on your local workstation:
A. Command Line - Linux and MacOS Users
Linux and MacOS Users can compress file(s) by executing the tar or zip command from their workstation's command line.
To start, use the cd command to browse to the directory where you want to store your compressed file. For example:
Here's an example of how to use the tar command:
tar -zcvf cptest.tar.gz /home/cptest
The z, c, v, and f flags used in this command are defined below:
Z: Filter the archive through gzip
F Use Archive file or device ARCHIVE.
Here's an example of how to use the zip command:
zip cptest.zip /home/cptest/*
B. Desktop - MacOS and Windows Users
MacOS and Windows Users can compress files directly from their Desktop. The default compression on MacOS and Windows is zip.
To compress your file(s) on MacOS, highlight the desired files in Finder, right-click, and select Compress to create an archive. Here's an example of what you should see on MacOS:
Windows users can perform similar steps. Simply highlight the files you want to compress in your file explorer window, right-click, and select the Compress option.
3. Browse to cPanel >> File Manager, navigate to the folder you wish to upload the compressed file to and click on the Upload button to bring up the interface seen in the image below:
Drag and drop (or use Select File) to choose the compressed file to upload.
4. A green progress bar will indicate if the upload was successful:
5. You can now navigate back to File Manager by clicking the Go Back to “/home/username" link seen at the bottom of the above image.
6. Select the newly uploaded compressed file and click on the Extract button seen in the top left corner of the File Manager interface. Here's an example of what you should see as the extraction completes: