{"id":188,"date":"2006-01-22T21:02:46","date_gmt":"2006-01-23T02:02:46","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/2006\/01\/22\/extract-a-tar-archive-relative-to-the-current-directory\/"},"modified":"2006-01-22T21:02:46","modified_gmt":"2006-01-23T02:02:46","slug":"extract-a-tar-archive-relative-to-the-current-directory","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2006\/01\/extract-a-tar-archive-relative-to-the-current-directory\/","title":{"rendered":"Extract a tar archive relative to the current directory"},"content":{"rendered":"\n<p>How to extract a tar that looks like relative to the current directory:<\/p>\n<p>$ tar -tvf MyArchive.tar<br \/>\n-rw-r&#8211;r&#8211; 100\/100 58239140 Jan 20 05:17 2006 \/home\/suramya\/bin\/File1.dat<br \/>\n-rw-r&#8211;r&#8211; 100\/100 56660587 Jan 19 16:07 2006 \/home\/suramya\/bin\/File2.dat<\/p>\n<p>I don&#8217;t want to extract these files to \/home\/suramya\/bin I want them relative to my current directory. The GNU tar program does this automatically but the Solaris version doesn&#8217;t. To fix this problem use the following command:<\/p>\n<p><code>pax -r -s ',^\/,,' -f MyArchive.tar<\/code><\/p>\n<p>This will extract MyArchive.tar in the current directory (By creating a home\/suramya\/bin directory in the current directory)<\/p>\n<p>Tip courtesy: <a href=\"http:\/\/www.columbia.edu\/~rtt2101\/iaoq\/#I.A1\">Solaris IAOQ<\/a><\/p>\n<p>&#8211; Suramya<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to extract a tar that looks like relative to the current directory: $ tar -tvf MyArchive.tar -rw-r&#8211;r&#8211; 100\/100 58239140 Jan 20 05:17 2006 \/home\/suramya\/bin\/File1.dat -rw-r&#8211;r&#8211; 100\/100 56660587 Jan 19 16:07 2006 \/home\/suramya\/bin\/File2.dat I don&#8217;t want to extract these files to \/home\/suramya\/bin I want them relative to my current directory. The GNU tar program does [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[13,14],"tags":[],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-linuxunix-related","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":0,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}