[AthlonRob at axpr.net: Re: [PLUG] untar multiple files]
David Phillips
redhat at crisponions.com
Thu Jan 13 04:04:11 UTC 2005
On Wed, 2005-01-12 at 09:10 -0800, Michael Rasmussen wrote:
> ----- Forwarded message from AthlonRob <AthlonRob at axpr.net> -----
>
> On Tue, 2005-01-11 at 22:31 -0800, David Phillips wrote:
> > Does anyone know of an easy way to untar/zip multiple files at once? I
> > figure a script is probably the best solution but unfortunately my
> > scripting skills are about non-existent at this point.
>
> Learn for loops:
>
> bash$ for i in *.tar.gz; do tar -xvzf $i; done
>
> ----- End forwarded message -----
>
>
> I'll enthusiastically second Rob's recommendation. Once you start to use
> loops they become second nature and you'll find lots of uses for them.
>
> Incidently this could also look something like this if you hit enter
> rather than semicolon:
>
> [mrasmuss at cmc02020 tmp]$ for i in *tgz
> do
> tar ztf $i
> done
> <output of the command
> [mrasmuss at cmc02020 tmp]$
>
That work great, Thanks! A new door has opened :-)
Dave P
More information about the PLUG
mailing list