{"id":282521,"date":"2021-06-23T19:00:00","date_gmt":"2021-06-23T16:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-extract-a-single-file-from-a-tar-tar-gz-archive-cloudsavvy-it\/"},"modified":"2021-06-23T19:00:00","modified_gmt":"2021-06-23T16:00:00","slug":"how-to-extract-a-single-file-from-a-tar-tar-gz-archive-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-extract-a-single-file-from-a-tar-tar-gz-archive-cloudsavvy-it\/","title":{"rendered":"#How to Extract a Single File from a .tar \/ .tar.gz Archive \u2013 CloudSavvy IT"},"content":{"rendered":"<p><strong>&#8220;#How to Extract a Single File from a .tar \/ .tar.gz Archive \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-4038\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/07\/add8ac45.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Bash Shell\" width=\"1400\" height=\"600\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you\u2019ve ever run into a scenario where you have a huge tar backup file but you only need to extract a single file, you\u2019re reading the right article today. Why bother extracting the whole thing just to grab that one file?<\/p>\n<p>Instead, you just need to know the syntax for extracting a single file out of that archive. And here is that syntax:<\/p>\n<pre>tar --extract --file=&lt;tarfile&gt; &lt;path\/to\/singlefile&gt;<\/pre>\n<p>So, for example, if you want to extract xmlrpc.php from a <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">download<\/a>ed WordPress archive, you\u2019d use the following, since everything inside of the wordpress tar file is in a \u201cwordpress\u201d folder.<\/p>\n<pre>tar --extract --file=latest.tar.gz wordpress\/xmlrpc.php<\/pre>\n<p>This, of course, is using the verbose syntax. Instead of using <code>--extract<\/code> you can use <code>-x<\/code>, and instead of using <code>--file<\/code> you can use <code>-f<\/code>, and you can even put them both together into a single argument like <code>-xf<\/code> instead. (Note: Historically you\u2019d also need the <code>-z<\/code> option to run through gzip, but in my testing it works fine without it). \u00a0So the shorter command would be:<\/p>\n<pre>tar -xf latest.tar.gz wordpress\/xmlrpc.php<\/pre>\n<p>You can also extract a single folder using the same syntax. For example, to grab the entire wordpress\/wp-includes folder from inside of the WordPress archive, you\u2019d simply do:<\/p>\n<pre>tar -xf latest.tar.gz wordpress\/wp-includes<\/pre>\n<p>There\u2019s also a <code>--wildcard<\/code> parameter that you can use to pull all files matching a pattern \u2014 for instance, if you wanted to grab all PNG images from an archive, you could do something like this:<\/p>\n<pre>tar -xf &lt;tarball&gt; --wildcards '*.png'<\/pre>\n<p>Hopefully you learned something today.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/2504\/how-to-extract-a-single-file-from-a-tar-tar-gz-archive\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Extract a Single File from a .tar \/ .tar.gz Archive \u2013 CloudSavvy IT&#8221; If you\u2019ve ever run into a scenario where you have a huge tar backup file but you only need to extract a single file, you\u2019re reading the right article today. Why bother extracting the whole thing just to grab that&#8230;<\/p>\n","protected":false},"author":1,"featured_media":282522,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/07\/add8ac45.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-282521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/282521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=282521"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/282521\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/282522"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=282521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=282521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=282521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}