<?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: assistance with tar in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621490#M925871</link>
    <description>Hi Sanman,&lt;BR /&gt;&lt;BR /&gt;Just remember that a relative path starts from your current directory.  The relative path you specify when creating the tar file is how it will be extracted - BUT it will be relative to your current directory when you actually do the extract.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;cd /home/sanman&lt;BR /&gt;tar cvf /dev/rmt/0m subdir1/subdir2/file1&lt;BR /&gt;&lt;BR /&gt;By the way, you can choose to start the path with a "./" if you wish but that isn't neccessary.&lt;BR /&gt;&lt;BR /&gt;So in the above example you have created a tarfile that contains one file.  When you extract that file using tar it will be written to the same relative path but it will be relative to your current directory then.&lt;BR /&gt;&lt;BR /&gt;So...&lt;BR /&gt;cd /var/tmp&lt;BR /&gt;tar xvf /dev/rmt/0m&lt;BR /&gt;will extract the file to /var/tmp/subdir1/subdir2/file1&lt;BR /&gt;&lt;BR /&gt;If /var/tmp/subdir1/subdir2 does not exist, it will be created.&lt;BR /&gt;&lt;BR /&gt;You could tar and extract the same file like this:&lt;BR /&gt;&lt;BR /&gt;cd /home/sanman/subdir1/subdir2&lt;BR /&gt;tar cvf /dev/rmt/0m file1&lt;BR /&gt;cd /var/tmp&lt;BR /&gt;tar xvf /dev/rmt/0m&lt;BR /&gt;&lt;BR /&gt;The difference with the second example is that the file will be extracted to /var/tmp/file1&lt;BR /&gt;&lt;BR /&gt;Lastly, if you don't know if a tarfile was created using relative or absloute pathnames, use the "tv" options to see the contents of the tarfile.&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Nov 2001 00:20:20 GMT</pubDate>
    <dc:creator>Darrell Allen</dc:creator>
    <dc:date>2001-11-29T00:20:20Z</dc:date>
    <item>
      <title>assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621484#M925865</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have a file that I would like to tar using relative path onto a tape. How would I do that. Any help will be greatly appreciated.</description>
      <pubDate>Wed, 28 Nov 2001 19:08:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621484#M925865</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2001-11-28T19:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621485#M925866</link>
      <description>Hi Sanman,&lt;BR /&gt;&lt;BR /&gt;Try this,&lt;BR /&gt;&lt;BR /&gt;The file you want to tar is &lt;BR /&gt;&lt;BR /&gt;/dir1/dir2/dir3/file_name&lt;BR /&gt;&lt;BR /&gt;you are presently in /home/mydir&lt;BR /&gt;&lt;BR /&gt;to take a tar backup, try&lt;BR /&gt;&lt;BR /&gt;tar cvf /dev/rmt/device_file  ../../dir1/dir2/dir3/file_name&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Nov 2001 19:11:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621485#M925866</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2001-11-28T19:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621486#M925867</link>
      <description>Let's say you are in / and you want to do this with /opt&lt;BR /&gt;&lt;BR /&gt;tar cvf filename.tar ./opt&lt;BR /&gt;&lt;BR /&gt;Then when you are done enter&lt;BR /&gt;&lt;BR /&gt;tar tvf filename.tar &lt;BR /&gt;&lt;BR /&gt;and verify that the files have a leading ., this will let you know for sure that they will extract relative to your current dir.&lt;BR /&gt;&lt;BR /&gt;Good Luck,&lt;BR /&gt;C</description>
      <pubDate>Wed, 28 Nov 2001 19:19:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621486#M925867</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-11-28T19:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621487#M925868</link>
      <description>Couple different ways:&lt;BR /&gt;&lt;BR /&gt;cd to / and put a . in front of the full path like:   ./etc/fstab      &lt;BR /&gt;tar cvf /dev/rmt/0m ./etc/fstab&lt;BR /&gt;&lt;BR /&gt;or cd to the directory and tar up the file from there&lt;BR /&gt;cd /etc&lt;BR /&gt;tar cvf /dev/rmt/0m fstab&lt;BR /&gt;&lt;BR /&gt;or tar the files up with the full path and use the pax utility to change the path when you untar them. pax is cool.</description>
      <pubDate>Wed, 28 Nov 2001 22:43:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621487#M925868</guid>
      <dc:creator>Bernie Vande Griend</dc:creator>
      <dc:date>2001-11-28T22:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621488#M925869</link>
      <description>The simplest way I can see is to cd one level higher to your target directory and do tar from there:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ex: you want to tar files under &lt;BR /&gt;&lt;BR /&gt;/test/test1/test2&lt;BR /&gt;&lt;BR /&gt;cd to /test/test1 then&lt;BR /&gt;&lt;BR /&gt;execute:&lt;BR /&gt;&lt;BR /&gt;#tar cvf test2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;d_b</description>
      <pubDate>Wed, 28 Nov 2001 23:44:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621488#M925869</guid>
      <dc:creator>Mary Ann Lipa</dc:creator>
      <dc:date>2001-11-28T23:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621489#M925870</link>
      <description>ooops, forgot the device file...&lt;BR /&gt;&lt;BR /&gt;it should be &lt;BR /&gt;&lt;BR /&gt;#tar cvf /dev/rmt/0m test2</description>
      <pubDate>Wed, 28 Nov 2001 23:45:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621489#M925870</guid>
      <dc:creator>Mary Ann Lipa</dc:creator>
      <dc:date>2001-11-28T23:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: assistance with tar</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621490#M925871</link>
      <description>Hi Sanman,&lt;BR /&gt;&lt;BR /&gt;Just remember that a relative path starts from your current directory.  The relative path you specify when creating the tar file is how it will be extracted - BUT it will be relative to your current directory when you actually do the extract.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;cd /home/sanman&lt;BR /&gt;tar cvf /dev/rmt/0m subdir1/subdir2/file1&lt;BR /&gt;&lt;BR /&gt;By the way, you can choose to start the path with a "./" if you wish but that isn't neccessary.&lt;BR /&gt;&lt;BR /&gt;So in the above example you have created a tarfile that contains one file.  When you extract that file using tar it will be written to the same relative path but it will be relative to your current directory then.&lt;BR /&gt;&lt;BR /&gt;So...&lt;BR /&gt;cd /var/tmp&lt;BR /&gt;tar xvf /dev/rmt/0m&lt;BR /&gt;will extract the file to /var/tmp/subdir1/subdir2/file1&lt;BR /&gt;&lt;BR /&gt;If /var/tmp/subdir1/subdir2 does not exist, it will be created.&lt;BR /&gt;&lt;BR /&gt;You could tar and extract the same file like this:&lt;BR /&gt;&lt;BR /&gt;cd /home/sanman/subdir1/subdir2&lt;BR /&gt;tar cvf /dev/rmt/0m file1&lt;BR /&gt;cd /var/tmp&lt;BR /&gt;tar xvf /dev/rmt/0m&lt;BR /&gt;&lt;BR /&gt;The difference with the second example is that the file will be extracted to /var/tmp/file1&lt;BR /&gt;&lt;BR /&gt;Lastly, if you don't know if a tarfile was created using relative or absloute pathnames, use the "tv" options to see the contents of the tarfile.&lt;BR /&gt;&lt;BR /&gt;Darrell&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Nov 2001 00:20:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assistance-with-tar/m-p/2621490#M925871</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2001-11-29T00:20:20Z</dc:date>
    </item>
  </channel>
</rss>

