From owner-freebsd-questions Mon Jan 18 11:19:41 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA22797 for freebsd-questions-outgoing; Mon, 18 Jan 1999 11:19:41 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA22791 for ; Mon, 18 Jan 1999 11:19:39 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.8.8/8.8.8) id OAA15707; Mon, 18 Jan 1999 14:18:46 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199901181918.OAA15707@cc942873-a.ewndsr1.nj.home.com> Subject: Re: about tar In-Reply-To: <36A382BE.DEA818A0@uk.radan.com> from Mark Ovens at "Jan 18, 99 06:51:42 pm" To: marko@uk.radan.com (Mark Ovens) Date: Mon, 18 Jan 1999 14:18:46 -0500 (EST) Cc: marko@websorcery.com, freebsd-questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mark Ovens wrote, > Marko's Work wrote: > > If I have a large tar file (ex/ backup.tgz), how would i go about > > extracting just one file from the archive (without extracting the path > > or anything else)?? > > tar will extract a file with any path it is stored with. [snip] Just to give you another option that avoids this problem, the -O switch on tar redirects to stdout. Your command line would be, % tar xOzf backup.tgz /full/path/in/tar/file > file Where file is the one you want. IMHO, if backup.tgz happens to be a backup of a whole filesystem or a very big chunk of one, use 'dump' rather than tar to create a backup. The interactive mode of 'restore' would be more convenient for this. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message