On Fri, 2002-09-06 at 03:58, Anthony E. Greene wrote: > On 05-Sep-2002/20:23 -0700, Gordon Messmer <[EMAIL PROTECTED]> wrote: > >find . -name '*.tar.gz' -exec tar zxf {} \; > > > >That's what you're thinking, right? Tar will be launched from the top > >level directory, and while it'll get the full path to the tarball, it'll > >extract all of the files at the top level. That does not preserve the > >directory structure, as the original poster asked. > > A for loop that uses the --directory option of tar and the output of > dirname would do the trick. > > for tarball in `find . -name '*.tar.gz'` ; do \ > tar --directory `dirname $tarball` -zxf $tarball ; done
--directory, eh? That's new to me ;) Good info, thanks. -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list