{"id":48963,"date":"2019-10-29T12:43:19","date_gmt":"2019-10-29T17:43:19","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=48963"},"modified":"2024-01-03T17:43:26","modified_gmt":"2024-01-03T22:43:26","slug":"zip-and-unzip-commands-basic-archiving","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/","title":{"rendered":"zip and unzip Commands &#8211; Basic Archiving"},"content":{"rendered":"\n<p>Learn how to create, extract, and list files within a compressed zip archive in <a href=\"\/support\/server\/ssh\/do-you-provide-ssh-access\/\">Secure Shell (SSH)<\/a>, or cPanel Terminal, with the <code>zip<\/code> and <code>unzip<\/code> commands.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#compress\">Create an archive<\/a><\/li>\n\n\n\n<li><a href=\"#decompress\">Extract Files<\/a><\/li>\n\n\n\n<li><a href=\"#list\">List Archived Files<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"alert alert-info\"> Spend more time working on your website than setup with our <a href=\"https:\/\/www.inmotionhosting.com\/shared-hosting\">Shared Hosting<\/a> &#8211; Softaculous Instant Installer and WP-CLI ready to go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"compress\">Compress Files<\/h2>\n\n\n\n<p>Use the <code>zip<\/code> command to manage compressed files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zip -r archive-name.zip path-to-directory-or-files<\/code><\/pre>\n\n\n\n<p>Example: <code>zip -r images.zip *.png<\/code> \u2013 Archive all PNG image files in the current directory into a images.zip file\nExample: <code>zip -r backup.zip *<\/code> \u2013 Archive all files and folders in the current directory into a backup.zip file<\/p>\n\n\n\n<p>Used options:<\/p>\n\n\n\n<p><code>-r<\/code> &#8211; Travel the directory structure recursively<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"decompress\">Decompress Files<\/h2>\n\n\n\n<p>Instead of <code>zip<\/code>, use the <code>unzip<\/code> command to manage compressed files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unzip archive.zip<\/code><\/pre>\n\n\n\n<p>Example: <code>unzip images.zip<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"specify\">Extract to Another Directory<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>unzip archive.zip -d another-folder<\/code><\/pre>\n\n\n\n<p>Example: <code>unzip images.zip -C restored<\/code> &#8211; Extract files from the images.zip file into the existing \/restored folder<\/p>\n\n\n\n<p>Used options:<\/p>\n\n\n\n<p><code>-d<\/code> &#8211; Specify directory<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"list\">List Files<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>unzip -l archive.zip<\/code><\/pre>\n\n\n\n<p>Used options:<\/p>\n\n\n\n<p><code>-l<\/code> &#8211; list archived files<\/p>\n\n\n\n<p>For more options, type the <code>zip --help<\/code> or <code>unzip --help<\/code> command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to create, extract, and list files within a compressed zip archive in Secure Shell (SSH), or cPanel Terminal, with the zip and unzip commands. Spend more time working on your website than setup with our Shared Hosting &#8211; Softaculous Instant Installer and WP-CLI ready to go. Compress Files Use the zip command to<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4308,4288],"tags":[],"class_list":["post-48963","post","type-post","status-publish","format-standard","hentry","category-linux","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>zip and unzip Commands - Basic Archiving | InMotion Hosting<\/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.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"zip and unzip Commands - Basic Archiving | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to create, extract, and list files within a compressed zip archive in Secure Shell (SSH), or cPanel Terminal, with the zip and unzip commands. Spend more time working on your website than setup with our Shared Hosting &#8211; Softaculous Instant Installer and WP-CLI ready to go. Compress Files Use the zip command to Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-29T17:43:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-03T22:43:26+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"zip and unzip Commands &#8211; Basic Archiving\",\"datePublished\":\"2019-10-29T17:43:19+00:00\",\"dateModified\":\"2024-01-03T22:43:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\"},\"wordCount\":158,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Linux\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\",\"name\":\"zip and unzip Commands - Basic Archiving | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2019-10-29T17:43:19+00:00\",\"dateModified\":\"2024-01-03T22:43:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"zip and unzip Commands &#8211; Basic Archiving\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"zip and unzip Commands - Basic Archiving | InMotion Hosting","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.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/","og_locale":"en_US","og_type":"article","og_title":"zip and unzip Commands - Basic Archiving | InMotion Hosting","og_description":"Learn how to create, extract, and list files within a compressed zip archive in Secure Shell (SSH), or cPanel Terminal, with the zip and unzip commands. Spend more time working on your website than setup with our Shared Hosting &#8211; Softaculous Instant Installer and WP-CLI ready to go. Compress Files Use the zip command to Read More >","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2019-10-29T17:43:19+00:00","article_modified_time":"2024-01-03T22:43:26+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"zip and unzip Commands &#8211; Basic Archiving","datePublished":"2019-10-29T17:43:19+00:00","dateModified":"2024-01-03T22:43:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/"},"wordCount":158,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Linux","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/","name":"zip and unzip Commands - Basic Archiving | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2019-10-29T17:43:19+00:00","dateModified":"2024-01-03T22:43:26+00:00","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/zip-and-unzip-commands-basic-archiving\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"zip and unzip Commands &#8211; Basic Archiving"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4288,"name":"Website","slug":"website","link":"https:\/\/www.inmotionhosting.com\/support\/website\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/48963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=48963"}],"version-history":[{"count":8,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/48963\/revisions"}],"predecessor-version":[{"id":108641,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/48963\/revisions\/108641"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=48963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=48963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=48963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}