Book 3.0pre4 Chapter5 Fileutils

Hector Resto shadowmanresto at
Wed Jul 4 13:02:20 PDT 2001

I posted about untar'ing a bunch of files at once not
too long ago.  This is the script I was given:

for i in ./*.tar
tar -xvf $i

There might a bunch of other ways to re-write this
script, but I know this one works and I'll keep using
it over and over again.  The reason I got interested
in a script like was because I was able to issue a
'bunzip2 *.bz2' at the command prompt without a
problem.  I then tried the 'tar -xvf *.tar' command,
but it didn't go anywhere.  I started looking thru the
tar man page, but nothing about handling a bunch of
files with wildcards.  I think this is where the LSB
is going to come in handy for many of the Linux
newcomers.  Why didn't someone think of maybe making a
patch for tar to handle many tar'ed files like bunzip2
did?  Oh well, all I know is that it works!  I'm

--- Matthias Kontny <matthiaskontny at> wrote:
> marcel.mulder at wrote:
> > Everybody should use, make or do what they think
> is best.
> > I want to make one remark about command prompts.
> Are they really more
> difficult to
> > handle then a GUI?
> depends on how well you know them. DOS is kinda easy
> to understand, whereas
> linux is something completely different in my
> opinion. sure, the basics are
> the same, but the bash has about 2^100 more
> possiblities ;)
> i'd say the GUI is for the normal user who doesn't
> have the time or wants to
> type, learn how it works etc
> > A lot of things can be done quicker or easier from
> the command prompt. I
> think we
> > always need both and everybody can decide for them
> self's how much they
> use each.
> yup. and it's not only on the shell that the
> keyboard is quicker than the
> mouse. on my windoze box (yes, i have one :P) i was
> unable to use my mouse
> for a whole weekend (cordless, batteries were gone
> *lol*) and i found out
> using the keyboard shortcuts is quicker than any
> mouse.
> also doing repeating tasks all the time can be
> greatly sped up by writing
> small scripts or batches.´
> i.e. "ls *.gz | mawk {'system ("tar xzf " $1 )'}" is
> _great_ to unpack all
> tar-gz packed files in one dir, no typing tar xzf
> filename.tar.gz over and
> over again till you have unpacked everything. same
> for bzip2, just use ls
> *.bz2 and tar xyf
> hmm... i lost it ;) maybe the mawk hint helped
> anyone *lol*
> Matthias
> -- 
> Unsubscribe: send email to
> lfs-discuss-request at
> and put unsubscribe in the subject header of the
> message

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
Unsubscribe: send email to lfs-discuss-request at
and put unsubscribe in the subject header of the message

More information about the lfs-dev mailing list