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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-05-2005, 05:04 PM
|
#1
|
Member
Registered: Jan 2004
Distribution: CentOS
Posts: 281
Rep:
|
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.
|
|
|
11-05-2005, 05:08 PM
|
#2
|
Moderator
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
|
cd into the folder you have stoed them and do tar zxvf *.tar.gz or tar xf *.tar and all should work.
|
|
|
11-05-2005, 05:10 PM
|
#3
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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 05:13 PM.
|
|
|
11-05-2005, 05:11 PM
|
#4
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
|
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
|
|
|
11-05-2005, 05:12 PM
|
#5
|
Member
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 356
Rep:
|
Code:
find . -name "*.tar" -exec tar xvf {} \;
edit: looks like I was too late
Last edited by TBC Cosmo; 11-05-2005 at 05:15 PM.
|
|
|
11-05-2005, 05:21 PM
|
#6
|
Member
Registered: Jan 2004
Distribution: CentOS
Posts: 281
Original Poster
Rep:
|
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 05:23 PM.
|
|
|
10-10-2006, 02:34 PM
|
#7
|
LQ Newbie
Registered: Jul 2003
Posts: 2
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 08:38 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|