Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how do i untar many files?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
dufnutz
Apprentice
Apprentice


Joined: 01 May 2002
Posts: 209

PostPosted: Tue Oct 01, 2002 5:04 pm    Post subject: how do i untar many files? Reply with quote

i downloaded all 181 gkrellm skins given by the gkrellm site. I want to un tar all of them so i can flip through them to find one i like.
i untared the first file ok and it gave me 181 new tar files for each theme. i figured i could do this

tar -xvf *.tar
but when i do that i get this err

Code:

tar: cyrus.tar: Not found in archive
tar: cyrus2.tar: Not found in archive
tar: dark-smokey.tar: Not found in archive
tar: dirtchamber.gkrellm.tar: Not found in archive
tar: eFVWM.tar: Not found in archive
tar: eLap.tar: Not found in archive
tar: eMac.tar: Not found in archive
tar: eSlate_gkrellm.tar: Not found in archive
tar: get-E-blue.gkrellm.tar: Not found in archive
tar: getE.gkrellm.tar: Not found in archive
tar: getE2.gkrellm.tar: Not found in archive
tar: gklcars.tar: Not found in archive
tar: gkrellm-nlog.tar: Not found in archive
tar: gkrellm-qn-x11.tar: Not found in archive
tar: glass.gkrellm.tar: Not found in archive
tar: greenHeart_gkrellm.tar: Not found in archive
tar: greyNeOn.gkrellm.tar: Not found in archive
tar: indiglow_blue-gkrellm.tar: Not found in archive
tar: invisible.tar: Not found in archive
tar: krooks.tar: Not found in archive
tar: m0kH4.tar: Not found in archive
tar: master.tar: Not found in archive
tar: matrix_feeling-0.1.tar: Not found in archive
tar: minE-Gkrellm.tar: Not found in archive
tar: minEguE_lite.tar: Not found in archive
tar: minegue-beta.tar: Not found in archive
tar: myway.tar: Not found in archive
tar: nIx_gkrellm.tar: Not found in archive
tar: null-gkrellm.tar: Not found in archive
tar: plain-black.tar: Not found in archive
tar: platinum.tar: Not found in archive
tar: propaganda2a.tar: Not found in archive
tar: propaganda2b.tar: Not found in archive
tar: r9x_gkrellm.tar: Not found in archive
tar: red.tar: Not found in archive
tar: sandymidnight.tar: Not found in archive
tar: spiff.tar: Not found in archive
tar: spiffE.tar: Not found in archive
tar: stirling.gkrellm.tar: Not found in archive
tar: sunset.gkrellm.tar: Not found in archive
tar: thinsys.tar: Not found in archive
tar: tiny.gkrellm.tar: Not found in archive
tar: trublu.tar: Not found in archive
tar: x17.tar: Not found in archive
tar: Error exit delayed from previous error


and so on for all the theme files. is there a quick way to do this or do i need to untar all them one by one
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Tue Oct 01, 2002 5:07 pm    Post subject: Reply with quote

Use a loop in your local friendly Bourne shell:
Code:
$ for file in `ls *.tar`; do tar xvf $file; done

_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
px
Guru
Guru


Joined: 26 Sep 2002
Posts: 497
Location: Metz, France

PostPosted: Tue Oct 01, 2002 5:30 pm    Post subject: Reply with quote

place yourself into the dir you want to untar and type:

for somevar in /dire_where_your_tar_are/*.tar; do tar -xvf $somevar; done;

You can also unzip multi file by replacing tar -xvf by unzip -o (to overwrite duplicate file)
Back to top
View user's profile Send private message
TuxFriend
Apprentice
Apprentice


Joined: 14 Aug 2002
Posts: 151

PostPosted: Tue Oct 01, 2002 5:34 pm    Post subject: Reply with quote

delta407 wrote:
Use a loop in your local friendly Bourne shell:
Code:
$ for file in `ls *.tar`; do tar xvf $file; done


If the name of the file has space(s) in it then $file is not complete. Only the part between space(s) is in $file and therefore it's not working. Any idea how to solve this?

TuxFriend
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Tue Oct 01, 2002 6:44 pm    Post subject: Reply with quote

How about this:
Code:
$ find ./ -name '*.tar' -print0 | xargs -0 tar xvf

_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
px
Guru
Guru


Joined: 26 Sep 2002
Posts: 497
Location: Metz, France

PostPosted: Tue Oct 01, 2002 6:52 pm    Post subject: Reply with quote

I think this should work:

for file in *.tar; do tar -xvf "$file"; done;
Back to top
View user's profile Send private message
dufnutz
Apprentice
Apprentice


Joined: 01 May 2002
Posts: 209

PostPosted: Tue Oct 01, 2002 7:42 pm    Post subject: Reply with quote

worked thanks guys
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum