[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tar for Idiots Question



Bob Bernstein <poobah@ruptured-duck.com> writes:
> I have a slew of tar.gz files in a directory, and I want to unpack them in
> that directory. I can't seem to "wildcardize" the usual commands I use to do
> this:
> 
> tar xzvf *tar.gz  (and)
> 
> gzip -dc *gz | tar xvf - 
> 
> both fail to do it.
> 
> Any help, praise, or blame would be welcome at this point!

The utility you're using has to support multiple files on the command
line and tar doesn't. As someone else pointed out you'll need a
"scriptlet" to do this. Something like:

for file in *tar.gz; do tar xzvf $file;done

Gary



Reply to: