Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-05-2005, 09:05 AM   #1
Registered: Aug 2005
Distribution: Arch Linux
Posts: 291

Rep: Reputation: 48
extracting multiple files with tar -xjvf

how do we untar multiple tar.bz2 or tar .gz files ?
tar -xjvf *.tar.bz2 does not seem to work.
secondly, does foo.tbz use
tar -cjvf foo.tbz foo/
or something else?
Old 11-05-2005, 09:19 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 60
1) Try this.
for i in *.gz; do tar -xzvf $i; done

2) Don't know what you are saying.
Old 11-05-2005, 09:24 AM   #3
Senior Member
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
Using sh
#for file in `ls *.tar.gz`
#tar zxvf $file
press enter after typing done
Old 11-06-2005, 02:21 AM   #4
Registered: Aug 2005
Distribution: Arch Linux
Posts: 291

Original Poster
Rep: Reputation: 48
oh thanks a lot.. i should have tried the script a long time back..
i was foolishly untarring individual files since a long time..

2) Don't know what you are saying.
i meant, are foo.tar.bz2 and foo.tbz created from the same command, i.e. tar -cjvf ...?
well, till now i assumed that they are.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 12:02 PM
geting problem in extracting tar files p_garg Linux - Enterprise 1 09-29-2005 03:53 PM
hey geting problem in extracting tar files in version 4 p_garg Linux - Networking 1 09-29-2005 03:48 PM
extracting tar.bz2.gz files crank Linux - Newbie 5 04-19-2004 12:33 AM
unpacking multiple .tar.gz files illtbagu Linux - General 5 01-18-2003 06:43 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:17 PM.

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