From owner-freebsd-questions Mon Jan 18 10:52:48 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA18593 for freebsd-questions-outgoing; Mon, 18 Jan 1999 10:52:48 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from post.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA18588 for ; Mon, 18 Jan 1999 10:52:46 -0800 (PST) (envelope-from marko@uk.radan.com) Received: from [158.152.75.22] (helo=uk.radan.com) by post.mail.demon.net with smtp (Exim 2.10 #1) id 102Jmx-0001ba-00; Mon, 18 Jan 1999 18:52:40 +0000 Organisation: Radan Computational Ltd., Bath, UK. Phone: +44-1225-320320 Fax: +44-1225-320311 Received: from beavis.uk.radan.com (beavis [193.114.228.122]) by uk.radan.com (8.6.10/8.6.10) with SMTP id SAA01072; Mon, 18 Jan 1999 18:52:11 GMT Received: from uk.radan.com (rasnt-1) by beavis.uk.radan.com (4.1/SMI-4.1) id AA10070; Mon, 18 Jan 99 18:52:09 GMT Message-Id: <36A382BE.DEA818A0@uk.radan.com> Date: Mon, 18 Jan 1999 18:51:42 +0000 From: Mark Ovens X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en-GB Mime-Version: 1.0 To: "Marko's Work" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: about tar References: <01be430e$656259a0$9d83b7d1@vidbox> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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)?? > Just to confuse everyone, this is marko replying to marko:-) tar will extract a file with any path it is stored with. However, you can change where that path starts. Say your file is (using tar tvf) usr/home/file. If you want to extract it to, say, /tmp use ``tar xf -C /tmp usr/home/file'' (change the options as req'd, e.g. zxf if its a gzip'd tar). This will extract the file to /tmp/usr/home/file, it may not be exactly what you want, but at least it won't overwrite the original. Note, the manpage for tar shows the ``-C'' option comes _after_ the filename(s) but I've found that doesn't work, you need the filename(s) last. HTH > Thanks for your help... > > marko@websorcery.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Trust the computer industry to shorten Year 2000 to Y2K. It was this thinking that caused the problem in the first place. My homepage http://www.users.globalnet.co.uk/~markov Mark Ovens, CNC Apps Engineer, | mailto:marko@uk.radan.com Radan Computational Ltd | http://www.radan.com Bath, England. CAD/CAM solutions | FreeBSD - The Power To Serve for the Sheetmetal Work industry.| http://www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message