<?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: Extracting from multiple tar files: Oneliner wanted in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131305#M62497</link>
    <description>Ivan&lt;BR /&gt;&lt;BR /&gt;I'm curious about your reply. I believed tar wanted a one-by-one list of file names as input. But, what you are saying is that I'm really supposed to supply the content of the tar files?&lt;BR /&gt;&lt;BR /&gt;If I have two tar files FILE1.tar and FILE2.tar, Then this (below) should work, but it doesn't. Tar only  extracts the first tar file. How come?&lt;BR /&gt;&lt;BR /&gt;$ ls&lt;BR /&gt;FILE1.tar  FILE2.tar&lt;BR /&gt;$ tar tvf FILE1.tar&lt;BR /&gt;-rw-r--r-- runar/wheel  401021 2008-02-27 08:42:06 typescript&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript1&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript10&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript2&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript3&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript4&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript5&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript6&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript7&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript8&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript9&lt;BR /&gt;$ tar tvf FILE2.tar&lt;BR /&gt;-rw-r--r-- runar/wheel  144244 2008-02-27 12:39:21 find_xargs.log&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:28:15 fred.foo&lt;BR /&gt;$ cat *.tar | tar xvf -&lt;BR /&gt;typescript&lt;BR /&gt;typescript1&lt;BR /&gt;typescript10&lt;BR /&gt;typescript2&lt;BR /&gt;typescript3&lt;BR /&gt;typescript4&lt;BR /&gt;typescript5&lt;BR /&gt;typescript6&lt;BR /&gt;typescript7&lt;BR /&gt;typescript8&lt;BR /&gt;typescript9&lt;BR /&gt;runar@MMtux:~/tmp$ ls &lt;BR /&gt;FILE1.tar  typescript   typescript10  typescript3  typescript5  typescript7  typescript9&lt;BR /&gt;FILE2.tar  typescript1  typescript2   typescript4  typescript6  typescript8&lt;BR /&gt;&lt;BR /&gt;Troy,&lt;BR /&gt;Thanx for the script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Runar&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 24 Sep 2008 06:08:29 GMT</pubDate>
    <dc:creator>Runar Jørgensen</dc:creator>
    <dc:date>2008-09-24T06:08:29Z</dc:date>
    <item>
      <title>Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131302#M62494</link>
      <description>Greetings&lt;BR /&gt;&lt;BR /&gt;I'm extracting files from multiple tar files. This for-loop works:&lt;BR /&gt;&lt;BR /&gt;$ for xx in `ls -1`; do tar xvf $xx; done&lt;BR /&gt;&lt;BR /&gt;but why doesn't this little thing work?&lt;BR /&gt;&lt;BR /&gt;$ ls -1 |awk '{print $1}' | tar xvf -&lt;BR /&gt;&lt;BR /&gt;Tar gives no error message, but no extracting gets done. Puzzling...&lt;BR /&gt;&lt;BR /&gt;Any pointers or comments?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Runar</description>
      <pubDate>Tue, 23 Sep 2008 10:00:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131302#M62494</guid>
      <dc:creator>Runar Jørgensen</dc:creator>
      <dc:date>2008-09-23T10:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131303#M62495</link>
      <description>The xvf - instruction assumes that you are passing to the pipe the content of a tar file, not a list of tar files, so it's different:&lt;BR /&gt;&lt;BR /&gt;cat test.tar | tar tvf -&lt;BR /&gt;ls test.tar | tar tvf -&lt;BR /&gt;&lt;BR /&gt;You are trying to do the second one, that won't ever work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Sep 2008 12:25:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131303#M62495</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2008-09-23T12:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131304#M62496</link>
      <description>HI ,&lt;BR /&gt; Try below shell code for extracting many files.&lt;BR /&gt;&lt;BR /&gt;tar_files=`ls *.tar 2&amp;gt;/dev/null`&lt;BR /&gt;&lt;BR /&gt;if [ -n "$tar_files" ]&lt;BR /&gt;then&lt;BR /&gt; for i in $tar_files&lt;BR /&gt; do&lt;BR /&gt;  tar -zxvf $i 2&amp;gt;&amp;amp;1&lt;BR /&gt; done&lt;BR /&gt;fi</description>
      <pubDate>Wed, 24 Sep 2008 03:51:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131304#M62496</guid>
      <dc:creator>Mr Arc</dc:creator>
      <dc:date>2008-09-24T03:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131305#M62497</link>
      <description>Ivan&lt;BR /&gt;&lt;BR /&gt;I'm curious about your reply. I believed tar wanted a one-by-one list of file names as input. But, what you are saying is that I'm really supposed to supply the content of the tar files?&lt;BR /&gt;&lt;BR /&gt;If I have two tar files FILE1.tar and FILE2.tar, Then this (below) should work, but it doesn't. Tar only  extracts the first tar file. How come?&lt;BR /&gt;&lt;BR /&gt;$ ls&lt;BR /&gt;FILE1.tar  FILE2.tar&lt;BR /&gt;$ tar tvf FILE1.tar&lt;BR /&gt;-rw-r--r-- runar/wheel  401021 2008-02-27 08:42:06 typescript&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript1&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript10&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript2&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript3&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript4&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript5&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript6&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript7&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript8&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:26:14 typescript9&lt;BR /&gt;$ tar tvf FILE2.tar&lt;BR /&gt;-rw-r--r-- runar/wheel  144244 2008-02-27 12:39:21 find_xargs.log&lt;BR /&gt;-rw-r--r-- runar/wheel       0 2008-02-27 12:28:15 fred.foo&lt;BR /&gt;$ cat *.tar | tar xvf -&lt;BR /&gt;typescript&lt;BR /&gt;typescript1&lt;BR /&gt;typescript10&lt;BR /&gt;typescript2&lt;BR /&gt;typescript3&lt;BR /&gt;typescript4&lt;BR /&gt;typescript5&lt;BR /&gt;typescript6&lt;BR /&gt;typescript7&lt;BR /&gt;typescript8&lt;BR /&gt;typescript9&lt;BR /&gt;runar@MMtux:~/tmp$ ls &lt;BR /&gt;FILE1.tar  typescript   typescript10  typescript3  typescript5  typescript7  typescript9&lt;BR /&gt;FILE2.tar  typescript1  typescript2   typescript4  typescript6  typescript8&lt;BR /&gt;&lt;BR /&gt;Troy,&lt;BR /&gt;Thanx for the script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Runar&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Sep 2008 06:08:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131305#M62497</guid>
      <dc:creator>Runar Jørgensen</dc:creator>
      <dc:date>2008-09-24T06:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131306#M62498</link>
      <description>That would be the same as:&lt;BR /&gt;&lt;BR /&gt;cat tar1.tar &amp;gt; tar3.tar&lt;BR /&gt;cat tar2.tar &amp;gt;&amp;gt; tar3.tar&lt;BR /&gt;&lt;BR /&gt;At that point, you should have tar1 and tar2 in the tar3.tar file. But the problem is that tar1.tar also stored it's end of tar archive mark in the file, so, you won't be able to continue above the end of the tar1 content even in the tar3 file.&lt;BR /&gt;&lt;BR /&gt;As you cannot "forward" a mark in the tarfile as in a tape (mt fsf), probably you won't be able to read the second tar.</description>
      <pubDate>Wed, 24 Sep 2008 13:23:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131306#M62498</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2008-09-24T13:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131307#M62499</link>
      <description>I use a couple of different commands, based on what I am un-tarring from:&lt;BR /&gt;from tape:&lt;BR /&gt;while [ $? == 0 ] ; do tar xvf /dev/nst0&lt;BR /&gt;&lt;BR /&gt;for a directory on disk&lt;BR /&gt;for x in $(ls &lt;DIRNAME&gt; ) ; do tar xvf /dev/nst0 &lt;DIRNAME&gt;/$x&lt;BR /&gt;&lt;BR /&gt;I also pipe the output to a file for review if needed. &lt;BR /&gt;&lt;BR /&gt;Ray&lt;/DIRNAME&gt;&lt;/DIRNAME&gt;</description>
      <pubDate>Wed, 24 Sep 2008 23:41:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131307#M62499</guid>
      <dc:creator>Ray Mitchell</dc:creator>
      <dc:date>2008-09-24T23:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from multiple tar files: Oneliner wanted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131308#M62500</link>
      <description>Excellent followups &lt;BR /&gt;Thanx&lt;BR /&gt;&lt;BR /&gt;Runar</description>
      <pubDate>Fri, 26 Sep 2008 07:16:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/extracting-from-multiple-tar-files-oneliner-wanted/m-p/5131308#M62500</guid>
      <dc:creator>Runar Jørgensen</dc:creator>
      <dc:date>2008-09-26T07:16:24Z</dc:date>
    </item>
  </channel>
</rss>

