From owner-freebsd-questions@FreeBSD.ORG Thu Nov 6 14:23:23 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D85A616A4CE for ; Thu, 6 Nov 2003 14:23:23 -0800 (PST) Received: from zim.0x7e.net (zim.0x7e.net [203.38.184.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id C69D543FEC for ; Thu, 6 Nov 2003 14:23:22 -0800 (PST) (envelope-from listone@deathbeforedecaf.net) Received: from goo.0x7e.net ([203.38.184.164] helo=goo) by zim.0x7e.net with smtp (Exim 3.36 #1) id 1AHsXB-000IJI-00; Fri, 07 Nov 2003 08:53:21 +1030 Message-ID: <00ee01c3a4b4$95d13450$a4b826cb@goo> From: "Rob" To: , "Martin McCormick" References: <200311062200.hA6M0uLH074820@dc.cis.okstate.edu> Date: Fri, 7 Nov 2003 08:53:20 +1030 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Subject: Re: Extracting individual Files via tar X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2003 22:23:24 -0000 You should always use the f option to specify the archive - for example tar -tzf archive.tgz to list or tar -xzf archive.tgz to extract. In your example below, you didn't specify an archive so it defaulted to the device /dev/sa0, which it couldn't open. Any extra arguments are treated as archive members - eg tar -xzf archive.tgz files/to/extract In your example below, it was trying to find 2 files in a non-existent archive. ----- Original Message ----- From: "Martin McCormick" Subject: Extracting individual Files via tar > The command > > tar ztf /usr/local/src/ports.tar.gz > > produces a table of contents just like the man page says it should. > The man page also says that individual files can be recovered or > listed but I haven't gotten that to work at all. if I try: > > $ tar zt ports/print/pstotext/ /usr/local/src/ports.tar.gz > > tar (child): /dev/sa0: Cannot open: Permission denied > tar (child): Error is not recoverable: exiting now > > gzip: stdin: unexpected end of file > tar: Child returned status 2 > tar: ports/print/pstotext: Not found in archive > tar: /usr/local/src/ports.tar.gz: Not found in archive > tar: Error exit delayed from previous errors > > In the successful test, tar obviously knew which specification > was the archive and was able to uncompress it with the z flag. The > file specification I am attempting to recover from the archive throws > tar completely off. I looked in the handbook and all the examples I > found were the more usual procedure of unpacking whole file systems > as in > > tar zxf somedir/archive.tar.gz > > I'm not having trouble with that use of tar. > > Thank you. > > Martin McCormick WB5AGZ Stillwater, OK > OSU Information Technology Division Network Operations Group > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >