{"id":5554,"date":"2023-12-23T15:49:56","date_gmt":"2023-12-23T21:49:56","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=5554"},"modified":"2023-12-23T15:49:56","modified_gmt":"2023-12-23T21:49:56","slug":"extract-part-of-a-tar-archive","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/extract-part-of-a-tar-archive\/","title":{"rendered":"Extract part of a tar archive"},"content":{"rendered":"\n<p>You can use <code>tar -tvf<\/code> to show the contents of a tar file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -tvf  filename.tgz<\/pre>\n\n\n\n<p>You can extract a portion of the archive with <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -zxvf filename.tgz path\/inside\/file -C destination\/path<\/pre>\n\n\n\n<p>For instance, if I have a tar backup of my \/home directory, and I need to extract a file out of the tarred Downloads to my current Downloads directory, I can do<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -zxvf home.tgz home\/incredigeek\/Downloads\/slack.deb ~\/Downloads<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/www.cyberciti.biz\/faq\/list-the-contents-of-a-tar-or-targz-file\/\">https:\/\/www.cyberciti.biz\/faq\/list-the-contents-of-a-tar-or-targz-file\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/24057301\/bash-extract-only-part-of-tar-gz-archive\">https:\/\/stackoverflow.com\/questions\/24057301\/bash-extract-only-part-of-tar-gz-archive<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use tar -tvf to show the contents of a tar file. tar -tvf filename.tgz You can extract a portion of the archive with tar -zxvf filename.tgz path\/inside\/file -C destination\/path For instance, if I have a tar backup of &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/extract-part-of-a-tar-archive\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[7,802,1623,1622],"class_list":["post-5554","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux-2","tag-tar","tag-tar-gz","tag-tgz"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=5554"}],"version-history":[{"count":1,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5554\/revisions"}],"predecessor-version":[{"id":5556,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5554\/revisions\/5556"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=5554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=5554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=5554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}