How to compress a file(s) or folder(s) using cPanel File Manager
Log in to cPanel
Scroll and find the Files section and then click on the File Manager icon.
Locate the folder that has the files you want to compress.
Select to highlight (macOS “command ⌘” and “CTRL” Linux & Windows) all the files you want to compress.
Visually confirm the selection.
Select “Compress” from the top right corner of the upper toolbar.
Select the archive type (.zip, .tar, .gz, or .bz2).
Ideally, set a custom name for the archive instead of using the automatic name that cPanel has chosen for you.
Click the Compress File(s) button.
Once the compression is complete, close the window.
Now highlight the newly created archive, and download it using the Download option in the toolbar.
To compress files, a directory or directories, use tar or zip command from within the directory you wish to archive:
tar -czvf about.tar public_html/about/
or
tar -czvf about.tar.gz public_html/about/
If you are already in the public_html:
tar -czvf about.tar about/
or
tar -czvf about.tar.gz about/
To delete/remove files from the tarball:
tar --delete -f about.tar $filename
To zip multiple files:
zip files.zip testfile1.txt testfile2.txt testfile3.txt testfile4.txt
To specify multiple files having the same extension, use the wildcard.
For instance, to zip all the files ending with .txt extension in a zip file, named files1.zip, issue the following command in the Terminal:
zip files1.zip *.txt
To create a zip archive of all files in /public_html directory:
zip public_html.zip /public_html/*
To zip the wp-content directory recursively to the test.zip file, the command would be:
zip -r wp-content.zip wp-content/