{"id":48948,"date":"2019-10-29T12:04:50","date_gmt":"2019-10-29T17:04:50","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=48948"},"modified":"2021-08-16T15:51:29","modified_gmt":"2021-08-16T19:51:29","slug":"tar-command-basic-archiving","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/","title":{"rendered":"tar Command &#8211; Basic Archiving"},"content":{"rendered":"\n<p>Learn how to create, extract, and list files within a compressed tar archive in <a href=\"\/support\/server\/ssh\/do-you-provide-ssh-access\/\">Secure Shell (SSH)<\/a>, or cPanel Terminal, with the <code>tar<\/code> command.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#create\">Create an archive<\/a><\/li><li><a href=\"#extract\">Extract Files<\/a><\/li><li><a href=\"#list\">List Archived Files<\/a><\/li><\/ul>\n\n\n\n<p class=\"alert alert-info\">Want to spend more time working on your website than setup? Check out our Shared Business Hosting with Softaculous Instant Installer and WP-CLI included.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create\">Create an Archive<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -czvf archive-name.tar.gz path-to-directory-or-files<\/code><\/pre>\n\n\n\n<p>Example: <code>tar -czvf images.tar.gz *.png<\/code> &#8211; Archive all PNG image files in the current directory into a images.tar.gz file<br>Example: <code>tar -czvf backup.tar.gz *<\/code> &#8211; Archive all files and folders in the current directory into a backup.tar.gz file<\/p>\n\n\n\n<p><code>-c<\/code> &#8211; create <br><code>-z<\/code> &#8211; compress or decompress <br><code>-v<\/code> &#8211; list files processed <br><code>-f<\/code> &#8211; specify filename<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"extract\">Extract Files<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -xzvf archive.tar.gz<\/code><\/pre>\n\n\n\n<p>Example: <code>tar -xzvf images.tar.gz<\/code><\/p>\n\n\n\n<p>Used options:<\/p>\n\n\n\n<p><code>-x<\/code> &#8211; Extract <br><code>-z<\/code> &#8211; compress or decompress <br><code>-v<\/code> &#8211; list files processed <br><code>-f<\/code> &#8211; specify filename<\/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>tar -xzvf archive.tar.gz -C another-folder<\/code><\/pre>\n\n\n\n<p>Example: <code>tar -xzvf images.tar.gz -C <em>restored<\/em><\/code> &#8211; Extract files from the images.tar.gz file into an existing \/restored folder<\/p>\n\n\n\n<p>Used options:<\/p>\n\n\n\n<p><code>-x<\/code> &#8211; Extract <br><code>-z<\/code> &#8211; compress or decompress <br><code>-v<\/code> &#8211; list files processed <br><code>-f<\/code> &#8211; specify filename <br><code>-C<\/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>tar -tvf archive.tar.gz<\/code><\/pre>\n\n\n\n<p>Used options:<\/p>\n\n\n\n<p><code>-t<\/code> &#8211; list files processed <br><code>-v<\/code> &#8211; list files processed (with more info including file size and date modified) <br><code>-f<\/code> &#8211; specify filename<\/p>\n\n\n\n<p>For more options, type the <code>tar --help<\/code> command or visit <a href=\"https:\/\/www.gnu.org\/software\/tar\/manual\/tar.html\" target=\"_blank\" rel=\"noreferrer noopener\">GNU.org<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to create, extract, and list files within a compressed tar archive in Secure Shell (SSH), or cPanel Terminal, with the tar command. Create an archive Extract Files List Archived Files Want to spend more time working on your website than setup? Check out our Shared Business Hosting with Softaculous Instant Installer and WP-CLI<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-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-48948","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>tar Command - 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\/tar-command-basic-archiving\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"tar Command - Basic Archiving | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to create, extract, and list files within a compressed tar archive in Secure Shell (SSH), or cPanel Terminal, with the tar command. Create an archive Extract Files List Archived Files Want to spend more time working on your website than setup? Check out our Shared Business Hosting with Softaculous Instant Installer and WP-CLI Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-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:04:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-16T19:51:29+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\/tar-command-basic-archiving\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"tar Command &#8211; Basic Archiving\",\"datePublished\":\"2019-10-29T17:04:50+00:00\",\"dateModified\":\"2021-08-16T19:51:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/\"},\"wordCount\":198,\"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\/tar-command-basic-archiving\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/\",\"name\":\"tar Command - Basic Archiving | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2019-10-29T17:04:50+00:00\",\"dateModified\":\"2021-08-16T19:51:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"tar Command &#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":"tar Command - 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\/tar-command-basic-archiving\/","og_locale":"en_US","og_type":"article","og_title":"tar Command - Basic Archiving | InMotion Hosting","og_description":"Learn how to create, extract, and list files within a compressed tar archive in Secure Shell (SSH), or cPanel Terminal, with the tar command. Create an archive Extract Files List Archived Files Want to spend more time working on your website than setup? Check out our Shared Business Hosting with Softaculous Instant Installer and WP-CLI Read More >","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2019-10-29T17:04:50+00:00","article_modified_time":"2021-08-16T19:51:29+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\/tar-command-basic-archiving\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"tar Command &#8211; Basic Archiving","datePublished":"2019-10-29T17:04:50+00:00","dateModified":"2021-08-16T19:51:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/"},"wordCount":198,"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\/tar-command-basic-archiving\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/","name":"tar Command - Basic Archiving | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2019-10-29T17:04:50+00:00","dateModified":"2021-08-16T19:51:29+00:00","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/tar-command-basic-archiving\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"tar Command &#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":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/48948","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=48948"}],"version-history":[{"count":8,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/48948\/revisions"}],"predecessor-version":[{"id":83152,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/48948\/revisions\/83152"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=48948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=48948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=48948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}