{"id":12887,"date":"2017-09-12T16:35:58","date_gmt":"2017-09-12T16:35:58","guid":{"rendered":"https:\/\/www.awardspace.com\/?page_id=12887"},"modified":"2024-02-27T13:26:59","modified_gmt":"2024-02-27T13:26:59","slug":"extract-archive-files","status":"publish","type":"post","link":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/","title":{"rendered":"How to extract archive files?"},"content":{"rendered":"<p>Extracting archive files can be accomplished in many ways, below you can find a few of them.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">File Manager<\/span><\/strong><br \/>\nIn the Control Panel -&gt; Hosting Tools -&gt; Website Manager -&gt; \u201cFile Manager\u201d there is an \u201cExtract\u201d button that automatically detects the file type of the archive and extracts the file in the directory, where it is located.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>SSH<\/strong><\/span><br \/>\nBefore you connect with SSH, you need to create an SSH account. You can use the <a href=\"\/kb\/create-ssh-account\/\">How to create an SSH account<\/a> guide.<br \/>\nThe SSH method requires you to first successfully connect through SSH (You can use the <a href=\"\/kb\/how-to-use-ssh-manager\/\">How to connect through SSH?<\/a> guide) and then you can execute the following commands depending on the type of your archive file:<\/p>\n<p>To extract a zipped file use this command:<br \/>\n<code>unzip <span style=\"color: #048eb0;\">YOUR_ARCHIVE.zip<\/span><\/code><\/p>\n<p>To extract a .rar file use this command:<br \/>\n<code>unrar -x <span style=\"color: #048eb0;\">YOUR_ARCHIVE.rar<\/span><\/code><\/p>\n<p>To extract an uncompressed tarball use this command:<br \/>\n<code>tar -xvf <span style=\"color: #048eb0;\">YOUR_ARCHIVE.tar<\/span><\/code><\/p>\n<p>To extract gzipped tarball use this command:<br \/>\n<code>tar -xvfz <span style=\"color: #048eb0;\">YOUR_ARCHIVE.tar.gz<\/span><\/code><\/p>\n<p>To extract bzipped tarball use this command:<br \/>\n<code>tar -xvfj <span style=\"color: #048eb0;\">YOUR_ARCHIVE.tar.bz2<\/span><\/code><\/p>\n<p>Make sure you replace <span style=\"color: #048eb0;\">YOUR_ARCHIVE<\/span> with the name of your archive file.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">PHP<\/span><\/strong><br \/>\nAnother solution for extracting different archives is through a PHP script. To do this, first, you need to create a PHP file inside the directory where the archive file is currently stored in your account and then you need to add the appropriate code inside the PHP file, depending on the archive type.<\/p>\n<p>To extract a zip file, you need to create a PHP file with the following content:<br \/>\n<code>&lt;?php<br \/>\n$zip = new ZipArchive;<br \/>\n$zip-&gt;open('<span style=\"color: #048eb0;\">YOUR_ARCHIVE.zip<\/span>');<br \/>\n$zip-&gt;extractTo('.\/');<br \/>\n$zip-&gt;close();<br \/>\necho \"OK!\";<br \/>\n?&gt;<\/code><br \/>\nTo extract a tar file, you need to create a PHP file with the following content:<br \/>\n<code>&lt;?php<br \/>\ntry {<br \/>\n$phar = new PharData('<span style=\"color: #048eb0;\">YOUR_ARCHIVE.tar<\/span>');<br \/>\n$phar-&gt;extractTo('.\/');<br \/>\necho ('File extracted');<br \/>\n} catch (Exception $e) {<br \/>\n}<br \/>\necho ('OK!')<br \/>\n?&gt;<\/code><\/p>\n<p>Make sure you replace <span style=\"color: #048eb0;\">YOUR_ARCHIVE<\/span> with the name of your archive file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Extracting archive files can be accomplished in many ways, below you can find a few of them. File Manager In the Control Panel -&gt; Hosting Tools -&gt; Website Manager -&gt; \u201cFile Manager\u201d there is an \u201cExtract\u201d button that automatically detects the file type of the archive and extracts the file in the directory, where it [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":33819,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[80,1],"tags":[],"class_list":["post-12887","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-secure-shell-ssh","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to extract archive files? - AwardSpace.com<\/title>\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.awardspace.com\/kb\/extract-archive-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to extract archive files? - AwardSpace.com\" \/>\n<meta property=\"og:description\" content=\"Extracting archive files can be accomplished in many ways, below you can find a few of them. File Manager In the Control Panel -&gt; Hosting Tools -&gt; Website Manager -&gt; \u201cFile Manager\u201d there is an \u201cExtract\u201d button that automatically detects the file type of the archive and extracts the file in the directory, where it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/\" \/>\n<meta property=\"og:site_name\" content=\"AwardSpace.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AwardSpace\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-12T16:35:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-27T13:26:59+00:00\" \/>\n<meta name=\"author\" content=\"ivailod\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@awspace\" \/>\n<meta name=\"twitter:site\" content=\"@awspace\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ivailod\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/\"},\"author\":{\"name\":\"ivailod\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/ce135bfb9f8b0d51d047abe11d77b221\"},\"headline\":\"How to extract archive files?\",\"datePublished\":\"2017-09-12T16:35:58+00:00\",\"dateModified\":\"2024-02-27T13:26:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/\"},\"wordCount\":276,\"publisher\":{\"@id\":\"https:\/\/www.awardspace.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"Secure Shell (SSH)\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/\",\"url\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/\",\"name\":\"How to extract archive files? - AwardSpace.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.awardspace.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2017-09-12T16:35:58+00:00\",\"dateModified\":\"2024-02-27T13:26:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.awardspace.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledge Base\",\"item\":\"https:\/\/www.awardspace.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Website Management \u2013 Advanced\",\"item\":\"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Secure Shell (SSH)\",\"item\":\"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/secure-shell-ssh\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to extract archive files?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.awardspace.com\/#website\",\"url\":\"https:\/\/www.awardspace.com\/\",\"name\":\"AwardSpace.com\",\"description\":\"Free Web Hosting with PHP, MySQL, Email Sending, No Ads\",\"publisher\":{\"@id\":\"https:\/\/www.awardspace.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.awardspace.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.awardspace.com\/#organization\",\"name\":\"AwardSpace.com\",\"url\":\"https:\/\/www.awardspace.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png\",\"contentUrl\":\"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png\",\"width\":1759,\"height\":176,\"caption\":\"AwardSpace.com\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/AwardSpace\/\",\"https:\/\/x.com\/awspace\",\"https:\/\/www.instagram.com\/awardspace\/\",\"https:\/\/www.quora.com\/profile\/Award-Space\",\"https:\/\/www.linkedin.com\/company\/19214384\/\",\"https:\/\/www.reddit.com\/user\/AwardSpace\",\"https:\/\/www.pinterest.com\/awardspace\/\",\"https:\/\/www.youtube.com\/user\/AwardspaceWebHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/ce135bfb9f8b0d51d047abe11d77b221\",\"name\":\"ivailod\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"ivailod\"},\"url\":\"https:\/\/www.awardspace.com\/author\/ivailod\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to extract archive files? - AwardSpace.com","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.awardspace.com\/kb\/extract-archive-files\/","og_locale":"en_US","og_type":"article","og_title":"How to extract archive files? - AwardSpace.com","og_description":"Extracting archive files can be accomplished in many ways, below you can find a few of them. File Manager In the Control Panel -&gt; Hosting Tools -&gt; Website Manager -&gt; \u201cFile Manager\u201d there is an \u201cExtract\u201d button that automatically detects the file type of the archive and extracts the file in the directory, where it [&hellip;]","og_url":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/","og_site_name":"AwardSpace.com","article_publisher":"https:\/\/www.facebook.com\/AwardSpace\/","article_published_time":"2017-09-12T16:35:58+00:00","article_modified_time":"2024-02-27T13:26:59+00:00","author":"ivailod","twitter_card":"summary_large_image","twitter_creator":"@awspace","twitter_site":"@awspace","twitter_misc":{"Written by":"ivailod","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#article","isPartOf":{"@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/"},"author":{"name":"ivailod","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/ce135bfb9f8b0d51d047abe11d77b221"},"headline":"How to extract archive files?","datePublished":"2017-09-12T16:35:58+00:00","dateModified":"2024-02-27T13:26:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/"},"wordCount":276,"publisher":{"@id":"https:\/\/www.awardspace.com\/#organization"},"image":{"@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage"},"thumbnailUrl":"","articleSection":["Secure Shell (SSH)"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/","url":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/","name":"How to extract archive files? - AwardSpace.com","isPartOf":{"@id":"https:\/\/www.awardspace.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage"},"image":{"@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage"},"thumbnailUrl":"","datePublished":"2017-09-12T16:35:58+00:00","dateModified":"2024-02-27T13:26:59+00:00","breadcrumb":{"@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.awardspace.com\/kb\/extract-archive-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.awardspace.com\/kb\/extract-archive-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.awardspace.com\/"},{"@type":"ListItem","position":2,"name":"Knowledge Base","item":"https:\/\/www.awardspace.com\/kb\/"},{"@type":"ListItem","position":3,"name":"Website Management \u2013 Advanced","item":"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/"},{"@type":"ListItem","position":4,"name":"Secure Shell (SSH)","item":"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/secure-shell-ssh\/"},{"@type":"ListItem","position":5,"name":"How to extract archive files?"}]},{"@type":"WebSite","@id":"https:\/\/www.awardspace.com\/#website","url":"https:\/\/www.awardspace.com\/","name":"AwardSpace.com","description":"Free Web Hosting with PHP, MySQL, Email Sending, No Ads","publisher":{"@id":"https:\/\/www.awardspace.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.awardspace.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.awardspace.com\/#organization","name":"AwardSpace.com","url":"https:\/\/www.awardspace.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png","contentUrl":"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png","width":1759,"height":176,"caption":"AwardSpace.com"},"image":{"@id":"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AwardSpace\/","https:\/\/x.com\/awspace","https:\/\/www.instagram.com\/awardspace\/","https:\/\/www.quora.com\/profile\/Award-Space","https:\/\/www.linkedin.com\/company\/19214384\/","https:\/\/www.reddit.com\/user\/AwardSpace","https:\/\/www.pinterest.com\/awardspace\/","https:\/\/www.youtube.com\/user\/AwardspaceWebHosting"]},{"@type":"Person","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/ce135bfb9f8b0d51d047abe11d77b221","name":"ivailod","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"ivailod"},"url":"https:\/\/www.awardspace.com\/author\/ivailod\/"}]}},"_links":{"self":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts\/12887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/comments?post=12887"}],"version-history":[{"count":0,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts\/12887\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/media?parent=12887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/categories?post=12887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/tags?post=12887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}