<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Question about tar in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672135#M51133</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;As far as I am aware, if you create the tar file (cvf) in a directory, ie /usr1 when you extract (xvf) the file will be extracted in the location that it was tarred, not the directory you reside when perform the xvf&lt;BR /&gt;&lt;BR /&gt;If this ok?&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Wed, 27 Feb 2002 02:15:52 GMT</pubDate>
    <dc:creator>steven Burgess_2</dc:creator>
    <dc:date>2002-02-27T02:15:52Z</dc:date>
    <item>
      <title>Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672133#M51131</link>
      <description>Sometimes when I extracted a tar file,they were created under current directory,but sometimes they were created under orginal directory. &lt;BR /&gt;&lt;BR /&gt;For example: tar xvf usr1.tar,the current directory is /test, the extracted files are created under /usr1, not under /test/usr1.&lt;BR /&gt;&lt;BR /&gt;why?</description>
      <pubDate>Wed, 27 Feb 2002 02:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672133#M51131</guid>
      <dc:creator>xujun</dc:creator>
      <dc:date>2002-02-27T02:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672134#M51132</link>
      <description>That is a function of how the tar was created.&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;tar cvf /dev/rmt/0m /u01&lt;BR /&gt;&lt;BR /&gt;All the files will be tar'ed with an absolute path /u01/* and restoring to another directory is difficult.&lt;BR /&gt;&lt;BR /&gt;If instead you first cd to /u01 and then do a&lt;BR /&gt;tar xcf /dev/rmt/0m . then all the files will be tar'ed as ./* and can be easily restored anywhere.&lt;BR /&gt;&lt;BR /&gt;Whenever possible, avoid the absolute pathnames when making tars.&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Feb 2002 02:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672134#M51132</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-02-27T02:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672135#M51133</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;As far as I am aware, if you create the tar file (cvf) in a directory, ie /usr1 when you extract (xvf) the file will be extracted in the location that it was tarred, not the directory you reside when perform the xvf&lt;BR /&gt;&lt;BR /&gt;If this ok?&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 27 Feb 2002 02:15:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672135#M51133</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-02-27T02:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672136#M51134</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This is from the tar man page:&lt;BR /&gt;&lt;BR /&gt;/quote/&lt;BR /&gt;&lt;BR /&gt;There is no way to restore an absolute path name to a relative position.&lt;BR /&gt;&lt;BR /&gt;/unquote/&lt;BR /&gt;&lt;BR /&gt;1) If you want absolute path:&lt;BR /&gt;&lt;BR /&gt;Creating the archive:&lt;BR /&gt;&lt;BR /&gt;# tar cvf usr1.tar /usr1&lt;BR /&gt;&lt;BR /&gt;Extracting the archive:&lt;BR /&gt;&lt;BR /&gt;# tar xvf usr1.tar&lt;BR /&gt;&lt;BR /&gt;2) If you want relative path:&lt;BR /&gt;&lt;BR /&gt;Creating the archive:&lt;BR /&gt;&lt;BR /&gt;# cd /usr1&lt;BR /&gt;# tar cvf usr1.tar *&lt;BR /&gt;&lt;BR /&gt;Extracting the archive:&lt;BR /&gt;&lt;BR /&gt;# mkdir -p /test/usr1&lt;BR /&gt;# cd /test/usr1&lt;BR /&gt;# tar xvf /usr1/usr1.tar&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Wed, 27 Feb 2002 02:27:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672136#M51134</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-02-27T02:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672137#M51135</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It depends on how the file was backed up. If it was backed up using absolute path name. It will be extracted using absolute path no matter where you are trying to extract upto. If this was backed up without using absolute path, they can be extracted to the current directory.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Feb 2002 03:20:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672137#M51135</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2002-02-27T03:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672138#M51136</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Before extracting a tar file, you should verify how files were added to it.  Use tar tvf and look to see if absolute pathnames were used to create the tar file.&lt;BR /&gt;&lt;BR /&gt;If you created the tar file using relative pathnames for the input files, tar will extract the files to locations relative to your current directory. &lt;BR /&gt;&lt;BR /&gt;If you created the tar file using absolute pathnames for the input files, tar will extract the files to that absolute path. &lt;BR /&gt;&lt;BR /&gt;An alternative for changing the extract destination for a tar file created with absolute pathnames is to use pax. An example is: &lt;BR /&gt;&lt;BR /&gt;tar cvf /tmp/users.tar /home/users&lt;BR /&gt;&lt;BR /&gt;tar xvf /tmp/users.tar &lt;BR /&gt;will extract files back to their original locations because the input file/dir was specified with an absolute pathname (/home/users) &lt;BR /&gt;&lt;BR /&gt;pax -r -s,/home/users,/home/users2, -f /tmp/users.tar &lt;BR /&gt;will extract files changing /home/users to /home/users2 &lt;BR /&gt;&lt;BR /&gt;See the man page for more info. &lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 27 Feb 2002 03:37:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672138#M51136</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-27T03:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Question about tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672139#M51137</link>
      <description>Thanks for Sanjay and all guys.&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Feb 2002 08:08:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-tar/m-p/2672139#M51137</guid>
      <dc:creator>xujun</dc:creator>
      <dc:date>2002-02-27T08:08:04Z</dc:date>
    </item>
  </channel>
</rss>

