LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-05-2005, 04:04 PM   #1
Rotwang
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 281

Rep: Reputation: 30
untar a list of tar files?


How do I untar a list of tar files? I tried:

tar xvf ./*.tar

I get a bunch of

"Not found in archive" messages, and nothing untars.
 
Old 11-05-2005, 04:08 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
cd into the folder you have stoed them and do tar zxvf *.tar.gz or tar xf *.tar and all should work.
 
Old 11-05-2005, 04:10 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,133

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Tar takes at most one tar file and interprets all other arguments as file to extract from that archive -- try something like:

Code:
find . -maxdepth 1 -name "*.tar" -exec tar xvf {} \;
edit: typo in find command.

Last edited by btmiller; 11-05-2005 at 04:13 PM.
 
Old 11-05-2005, 04:11 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
That won't work as it would try to extract the remaining tarballs from the first one.
You can do this instead:
Code:
for i in *.tar
do
tar xf "$i"
done
 
Old 11-05-2005, 04:12 PM   #5
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Code:
find . -name "*.tar" -exec tar xvf {} \;
edit: looks like I was too late

Last edited by TBC Cosmo; 11-05-2005 at 04:15 PM.
 
Old 11-05-2005, 04:21 PM   #6
Rotwang
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 281

Original Poster
Rep: Reputation: 30
I love this site, I get three different solutions, in 8 minutes, any one of which will work. Thanks,

rw

EDIT: Well, tar xf *.tar doesn't work, but still.

Last edited by Rotwang; 11-05-2005 at 04:23 PM.
 
Old 10-10-2006, 01:34 PM   #7
ajays
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by jlliagre
That won't work as it would try to extract the remaining tarballs from the first one.
You can do this instead:
Code:
for i in *.tar
do
tar xf "$i"
done
that worked for me
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to untar all tar-files in a directory? zoomzoom Linux - Newbie 6 07-22-2009 10:03 AM
Whats the command to untar files that end in .tar.bz2? BaZiL Linux - Newbie 3 06-20-2007 10:51 AM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 08:50 AM
list files in a tar.gz file linuxtesting2 Linux - Newbie 4 09-23-2004 02:49 AM
Bash script (untar *.tar files and then cd to the untared dir) k0ljat Linux - Newbie 2 12-30-2003 05:57 AM


All times are GMT -5. The time now is 07:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration