From owner-freebsd-questions Thu Dec 6 11:18:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from blacklamb.mykitchentable.net (ekgr-dsl2-77.citlink.net [207.173.226.77]) by hub.freebsd.org (Postfix) with ESMTP id AE68D37B405 for ; Thu, 6 Dec 2001 11:18:25 -0800 (PST) Received: from mykitchentable.net (localhost [127.0.0.1]) by blacklamb.mykitchentable.net (Postfix) with SMTP id 5C59CEE64C; Thu, 6 Dec 2001 11:20:02 -0800 (PST) Received: from 165.107.42.150 (SquirrelMail authenticated user tomlinson_dr) by www.mykitchentable.net with HTTP; Thu, 6 Dec 2001 11:20:02 -0800 (PST) Message-ID: <1766.165.107.42.150.1007666402.squirrel@www.mykitchentable.net> Date: Thu, 6 Dec 2001 11:20:02 -0800 (PST) Subject: =?iso-8859-1?Q?Re:_How_to_Untar_Group_of_Files=3F?= From: "Drew Tomlinson" To: In-Reply-To: <20011206090657.A38012@wopr.caltech.edu> References: <20011206090657.A38012@wopr.caltech.edu> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: , X-Mailer: SquirrelMail (version 1.2.0 [cvs]) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matthew Hunt said: > On Thu, Dec 06, 2001 at 10:59:28AM -0800, Drew Tomlinson wrote: > >> I have a directory with several *.tar.gz files that I want to untar to >> another directory. I tested my command "tar xfvz file.tar.gz -C >> /new/dir" and it worked OK. Next I tried "tar xfvz * -C /new/dir" but >> received errors like this: >> >> tar: file1.tar.gz not found in archive >> tar: file2.tar.gz not found in archive >> tar: file3.tar.gz not found in archive >> tar: file4.tar.gz not found in archive > > Right, tar can take the name of exactly one archive, and multiple > files to be found therein. It can't take multiple archive names. > >> How should I structure my command to untar all the files at once? > > Use your shell's looping constructs; in sh or similar (non-csh) > shells, something like: > > for tarfile in $.tar.gz; do tar xfvz $tarfile -C /new/dir; done > > (I find the mix of dashed and non-dashed tar arguments aesthetically > displeasing, so I would say: > > for tarfile in $.tar.gz; do tar xzvfC $tarfile /new/dir; done > ) Thanks!!! I'll try it. Drew > > -- > Matthew Hunt * Inertia is a property > http://www.pobox.com/~mph/ * of matter. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message