LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2004, 01:08 AM   #1
hq4ever
Member
 
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Rep: Reputation: 15
Extract multiple bz2 files


i have some files (tarballs?) that are compressed with bunzip2
i would like to extract them all at once.

i tried
Code:
ls *.bz2 | bunzip2
but i keep getting
Quote:
(stdin) is not a bzip2 file.
what is the correct syntax ?
 
Old 06-23-2004, 01:42 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Easiest way to do this:

bunzip2 *bz2

If you really need the ls construct:

ls *bz2 | xargs bunzip2

And this works as well:

for THIS in *bz2; do bunzip2 $THIS; done

There are probably more ways of doing this, these came to mind first.
 
Old 06-23-2004, 04:51 PM   #3
hq4ever
Member
 
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Original Poster
Rep: Reputation: 15
is it OK to say thank you in here
or does it considered spam post ?

any way i'll take the Chance, tnx man great help on that
i hate being a newbie.
 
Old 06-23-2004, 05:46 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
It's OK to say thanks :} ... and if you want to
do better than that, affero him ;) He may get a
present at some stage!

/me has got a signed Stallman book that way :}



Cheers,
Tink
 
Old 06-24-2004, 12:03 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@hq4ever: You're welcome.
 
  


Reply



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
how to extract a "tar.bz2" file? deWin Linux - Newbie 14 08-09-2016 08:49 AM
tar.bz2 Fails To Extract carlosinfl Linux - General 6 10-16-2005 12:33 PM
extract .tar.bz2 EcceVery Debian 3 11-24-2004 12:39 PM
How can konqueror view html files in .gz & .bz2 files directly? ailinzhe Linux - Software 5 05-24-2004 08:36 AM
How to extract tar.bz2 files? akihandyman Linux - Newbie 3 12-21-2003 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration