{"id":665,"date":"2021-07-06T07:38:27","date_gmt":"2021-07-06T12:38:27","guid":{"rendered":"https:\/\/www.knownhost.com\/kb\/?p=665"},"modified":"2026-01-23T14:54:19","modified_gmt":"2026-01-23T20:54:19","slug":"how-to-compress-and-uncompress-files-with-cpanel","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/","title":{"rendered":"How to Compress and Uncompress Files with cPanel"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #212121;color:#212121\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #212121;color:#212121\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#introduction\" >Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#what_is_compression\" >What is compression?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#how_do_i_compress_a_file\" >How do I compress a file?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#on_a_windows_7_pc_single_file_or_folder\" >On a Windows 7 PC (single file or folder)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#on_a_mac_multiple_files\" >On a Mac (multiple files)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#how_do_i_uncompress_the_file_once_i_transfer_it\" >How do I uncompress the file once I transfer it?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#uncompressing_an_archive_using_cpanels_file_manager\" >Uncompressing an archive using cPanel&#8217;s File Manager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#uncompressing_an_archive_using_ssh\" >Uncompressing an archive using SSH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#how_do_i_compress_a_file_on_my_server\" >How do I compress a file on my server?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#compressing_files_and_folders_in_cpanels_file_manager\" >Compressing file(s) and folder(s) in cPanel&#8217;s File Manager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#compressing_files_and_folders_via_ssh\" >Compressing file(s) and folder(s) via SSH<\/a><\/li><\/ul><\/nav><\/div>\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When transferring files to or from your server, it&#8217;s always best to compress them to make the transfer slightly smaller, and most importantly guard against corruption during the transfer process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"what_is_compression\"><\/span>What is compression?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Any Windows, Linux and Apple computer are able to compress files. There are several different kinds of compression, but we&#8217;ll focus on the three most common compression file types: .zip, .tar, and .gz. Zip is a compressed archive (for multple files, usually) while tar is used for a single archive of a file. Gzip (.gz) is the compression of a file or multiple files.<\/p>\n\n\n\n<p>You&#8217;ll find that most files that are compressed on a Linux server are using the suffix &#8220;.tar.gz&#8221;, while PC&#8217;s will use the &#8220;.zip&#8221; compression. Windows and Mac computers have the &#8220;zip&#8221; utility by default, just like your server. So we&#8217;ll work with that file type.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"how_do_i_compress_a_file\"><\/span>How do I compress a file?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"400\" height=\"316\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png\" alt=\"\" class=\"wp-image-666\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png 400w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows-300x237.png 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"on_a_windows_7_pc_single_file_or_folder\"><span class=\"ez-toc-section\" id=\"on_a_windows_7_pc_single_file_or_folder\"><\/span>On a Windows 7 PC (single file or folder)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Single Click + &lt;Control&gt; on a file or folder.<\/li><li>Click on &#8220;Compress &lt;file name here&gt;&#8221;<\/li><li>This will compress the file automatically, and highlight the compressed file or folder.<\/li><li>If you want to rename the archive:<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>Single Click + &lt;Control&gt; on the archive.<\/li><li>Click on &#8220;Rename&#8221;<\/li><li>Type in the name you wish to rename the archive to, and hit &lt;Return&gt;.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"on_a_mac_multiple_files\"><\/span>On a Mac (multiple files)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Click on a file, then press and hold &#8220;&lt;Command&gt;&#8221;.<\/li><li>Click on each file you want to add to your archive &#8211; you can add as many as you want.<\/li><li>Once done, let go of &lt;Command&gt; and Single Click + &lt;Control&gt; on one of the folders or files you have selected.<\/li><li>Click on &#8220;Compress &lt;#&gt; Items&#8221;.<\/li><li>This will compress all of the files automatically, and highlight the compressed file or folder.<\/li><li>If you want to rename the archive:<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>Single Click + &lt;Control&gt; on the archive.<\/li><li>Click on &#8220;Rename&#8221;<\/li><li>Type in the name you wish to rename the archive to, and hit &lt;Return&gt;.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"how_do_i_uncompress_the_file_once_i_transfer_it\"><\/span>How do I uncompress the file once I transfer it?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once you transfer the file to your server using&nbsp;FTP, or via the cPanel File Manager ((cPanel \u00bb Home \u00bb Files \u00bb File Manager) you can uncompress the file(s) you compressed on your computer, and they&#8217;ll retain the same directory structure in the location you uncompress.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"451\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/file_manager-1024x451.png\" alt=\"\" class=\"wp-image-667\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/file_manager-1024x451.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/file_manager-300x132.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/file_manager-768x339.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/file_manager.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"399\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/open_filemgr-1024x399.png\" alt=\"\" class=\"wp-image-668\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/open_filemgr-1024x399.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/open_filemgr-300x117.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/open_filemgr-768x299.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/open_filemgr.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"509\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_extract-1024x509.png\" alt=\"\" class=\"wp-image-669\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_extract-1024x509.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_extract-300x149.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_extract-768x382.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_extract.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"518\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extract_confirm-1024x518.png\" alt=\"\" class=\"wp-image-670\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extract_confirm-1024x518.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extract_confirm-300x152.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extract_confirm-768x388.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extract_confirm.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"661\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extraction_results-1024x661.png\" alt=\"\" class=\"wp-image-671\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extraction_results-1024x661.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extraction_results-300x194.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extraction_results-768x496.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/extraction_results.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"uncompressing_an_archive_using_cpanels_file_manager\"><\/span>Uncompressing an archive using cPanel&#8217;s File Manager<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Login to your cPanel account located at&nbsp;domain.tld:2083<\/li><li>Navigate to &#8220;Home &gt; Files &gt; File Manager&#8221; and click on the File Manager Icon.<br>A new tab with the File Manager should open on your browser.<\/li><li>On the left side, navigate to the location you transferred your archive to, and click on it.<\/li><li>In the center pane, the location of the folder you clicked on should open. Locate your archived file.<\/li><li>Single click the archived file.<\/li><li>On the top bar, just below &#8220;Search&#8221; &amp; &#8220;Settings&#8221;, is a row of commands. Locate &#8220;Extract&#8221; and press it.<\/li><li>A popup titled &#8220;Extract&#8221; should appear. If you want to change the path of where the files will uncompress to, type in the location. Otherwise, leave the edit box in the middle un-modified.<\/li><li>Click on &#8220;Extract File(s)&#8221;.<\/li><li>Once done, a new popup with the title &#8220;Extraction Results&#8221; should pop up, describing the uncompression.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"962\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/unzip_ssh-1024x962.png\" alt=\"\" class=\"wp-image-672\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/unzip_ssh-1024x962.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/unzip_ssh-300x282.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/unzip_ssh-768x721.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/unzip_ssh.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"uncompressing_an_archive_using_ssh\"><\/span>Uncompressing an archive using SSH<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Connect to your server using PuTTy or terminal command line &#8220;SSH&#8221;. Remember to edit the port to point to the correct one.<\/li><li>Navigate to the location where your archive is.<\/li><li>Use the command &#8220;unzip &lt;name of your file&gt;&#8221;.<\/li><li>Once done, the command will scroll and describe the uncompression.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"how_do_i_compress_a_file_on_my_server\"><\/span>How do I compress a file on my server?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can compress a file on your server just like you can from your computer, though it&#8217;s a little different. There are multiple ways to do this, but we&#8217;ll focus on SSH and the cPanel File Manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"441\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_compress-1024x441.png\" alt=\"\" class=\"wp-image-673\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_compress-1024x441.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_compress-300x129.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_compress-768x331.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/press_compress.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"738\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compress_confirm-1024x738.png\" alt=\"\" class=\"wp-image-674\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compress_confirm-1024x738.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compress_confirm-300x216.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compress_confirm-768x554.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compress_confirm.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"648\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compression_results-1024x648.png\" alt=\"\" class=\"wp-image-675\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compression_results-1024x648.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compression_results-300x190.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compression_results-768x486.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/compression_results.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"compressing_files_and_folders_in_cpanels_file_manager\"><\/span>Compressing file(s) and folder(s) in cPanel&#8217;s File Manager<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Login to your cPanel account located at&nbsp;domain.tld:2083<\/li><li>Navigate to &#8220;Home &gt; Files &gt; File Manager&#8221; and click on the File Manager Icon.<br>A new tab with the File Manager should open on your browser.<\/li><li>On the left side you can navigate to the folder(s) or file(s) you wish to compress.<br>Keep in mind you can only compress folders and files in the same directory with the File Manager.<\/li><li>Click on the file(s) and folder(s) you wish to compress.<br>If on Windows, you can press &lt;Ctrl&gt; and click multiple items.<br>If on Mac, you can press &lt;Command&gt; and click multiple items.<\/li><li>On the top bar where &#8220;File, Folder, Copy, Move&#8221; commands are located, the command &#8220;Compress&#8221; is located at the end.<\/li><li>Press on &#8220;Compress&#8221;.<\/li><li>Select Compression Type &#8211; you should choose &#8220;Zip&#8221; since Mac and Windows both have these utilities installed by default.<\/li><li>Enter the name of what you want the compressed file to be, and press &#8220;Compress File(s)&#8221;.<\/li><li>A popup named &#8220;Compression Results&#8221; should appear, descriibing the compression.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"217\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/zip_ssh-1024x217.png\" alt=\"\" class=\"wp-image-676\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/zip_ssh-1024x217.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/zip_ssh-300x64.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/zip_ssh-768x163.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/zip_ssh.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"compressing_files_and_folders_via_ssh\"><\/span>Compressing file(s) and folder(s) via SSH<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Connect to your server using PuTTy or terminal command line &#8220;SSH&#8221;. Remember to edit the port to point to the correct one.<\/li><li>Navigate to the location where you want to compress your file(s) or folder(s).<\/li><li>Use the command &#8220;zip&#8221; to compress the files:<br>To compress multiple folders or files, you should always use the &#8220;-r&#8221; option, which stands for &#8220;recursively&#8221;. This will ensure all folder contents are compressed along with the folder, and not just the folder.<\/li><li>Once done, the command will scroll and describe the compression, and creating the archive in the process.<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code> Example: zip -r myfiles.zip docs\/ myfileone.txt public_html\/ knownhostisawesome.txt php.ini<\/code><\/pre>\n\n\n<div class=\"kb-shortcode kb-shortcode_info\">\n                    <div class=\"kb-shortcode-icon\">\n                        <i class=\"fa fa-info-circle fa-2x\"><\/i>\n                    <\/div>\n                    <div class=\"kb-shortcode-content_info\">The above command will create a zip file called &#8220;myfiles.zip&#8221; and then compress the folders &#8220;docs&#8221; and &#8220;public_html&#8221;, and the files &#8220;myfileone.txt, knownhostisawesome.txt, and php.ini&#8221;.<\/div>\n                <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction When transferring files to or from your server, it&#8217;s always best to compress them to make the transfer slightly smaller, and most importantly guard against corruption during the transfer process. What is compression? Any Windows, Linux and Apple computer are able to compress files. There are several different kinds of compression, but we&#8217;ll focus [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[307,304,109,306,123,145,144,305],"class_list":["post-665","post","type-post","status-publish","format-standard","hentry","category-cpanel","tag-archive","tag-compress","tag-cpanel","tag-gzip","tag-linux","tag-reseller","tag-shared","tag-uncompress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Compress and Uncompress Files with cPanel - KnownHost<\/title>\n<meta name=\"description\" content=\"Learn how to compress and uncompress files on your KnownHost server using cPanel. Need more control? We also show you how to do this over SSH\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Compress and Uncompress Files with cPanel - KnownHost\" \/>\n<meta property=\"og:description\" content=\"Learn how to compress and uncompress files on your KnownHost server using cPanel. Need more control? We also show you how to do this over SSH\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-06T12:38:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-23T20:54:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"316\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jonathan K. W.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan K. W.\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/\"},\"author\":{\"name\":\"Jonathan K. W.\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"headline\":\"How to Compress and Uncompress Files with cPanel\",\"datePublished\":\"2021-07-06T12:38:27+00:00\",\"dateModified\":\"2026-01-23T20:54:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/\"},\"wordCount\":987,\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/sendto_windows.png\",\"keywords\":[\"archive\",\"compress\",\"cpanel\",\"gzip\",\"linux\",\"reseller\",\"shared\",\"uncompress\"],\"articleSection\":[\"cPanel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/\",\"name\":\"How to Compress and Uncompress Files with cPanel - KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/sendto_windows.png\",\"datePublished\":\"2021-07-06T12:38:27+00:00\",\"dateModified\":\"2026-01-23T20:54:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"description\":\"Learn how to compress and uncompress files on your KnownHost server using cPanel. Need more control? We also show you how to do this over SSH\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/sendto_windows.png\",\"contentUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/sendto_windows.png\",\"width\":400,\"height\":316},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-compress-and-uncompress-files-with-cpanel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Compress and Uncompress Files with cPanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\",\"name\":\"KnownHost\",\"description\":\"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\",\"name\":\"Jonathan K. W.\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"caption\":\"Jonathan K. W.\"},\"sameAs\":[\"https:\\\/\\\/www.knownhost.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Compress and Uncompress Files with cPanel - KnownHost","description":"Learn how to compress and uncompress files on your KnownHost server using cPanel. Need more control? We also show you how to do this over SSH","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to Compress and Uncompress Files with cPanel - KnownHost","og_description":"Learn how to compress and uncompress files on your KnownHost server using cPanel. Need more control? We also show you how to do this over SSH","og_url":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/","og_site_name":"KnownHost","article_published_time":"2021-07-06T12:38:27+00:00","article_modified_time":"2026-01-23T20:54:19+00:00","og_image":[{"width":400,"height":316,"url":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png","type":"image\/png"}],"author":"Jonathan K. W.","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan K. W.","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/"},"author":{"name":"Jonathan K. W.","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"headline":"How to Compress and Uncompress Files with cPanel","datePublished":"2021-07-06T12:38:27+00:00","dateModified":"2026-01-23T20:54:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/"},"wordCount":987,"image":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png","keywords":["archive","compress","cpanel","gzip","linux","reseller","shared","uncompress"],"articleSection":["cPanel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/","url":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/","name":"How to Compress and Uncompress Files with cPanel - KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#primaryimage"},"image":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png","datePublished":"2021-07-06T12:38:27+00:00","dateModified":"2026-01-23T20:54:19+00:00","author":{"@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"description":"Learn how to compress and uncompress files on your KnownHost server using cPanel. Need more control? We also show you how to do this over SSH","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#primaryimage","url":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png","contentUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/sendto_windows.png","width":400,"height":316},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/kb\/how-to-compress-and-uncompress-files-with-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Compress and Uncompress Files with cPanel"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/kb\/#website","url":"https:\/\/www.knownhost.com\/kb\/","name":"KnownHost","description":"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b","name":"Jonathan K. W.","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","caption":"Jonathan K. W."},"sameAs":["https:\/\/www.knownhost.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":2,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"predecessor-version":[{"id":8050,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/665\/revisions\/8050"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}