From owner-freebsd-questions@FreeBSD.ORG Mon Nov 10 16:32:31 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C38FE1065679 for ; Mon, 10 Nov 2008 16:32:31 +0000 (UTC) (envelope-from chloekcy2000@yahoo.ca) Received: from n10.bullet.re3.yahoo.com (n10.bullet.re3.yahoo.com [68.142.237.123]) by mx1.freebsd.org (Postfix) with SMTP id 6C9CB8FC13 for ; Mon, 10 Nov 2008 16:32:31 +0000 (UTC) (envelope-from chloekcy2000@yahoo.ca) Received: from [68.142.237.87] by n10.bullet.re3.yahoo.com with NNFMP; 10 Nov 2008 16:20:18 -0000 Received: from [69.147.75.190] by t3.bullet.re3.yahoo.com with NNFMP; 10 Nov 2008 16:20:18 -0000 Received: from [127.0.0.1] by omp106.mail.re1.yahoo.com with NNFMP; 10 Nov 2008 16:20:18 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 721594.7664.bm@omp106.mail.re1.yahoo.com Received: (qmail 41067 invoked by uid 60001); 10 Nov 2008 16:20:18 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.ca; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=aO0CLi1wNBnGO2YJxl73kj3+uwhnmUOmeqBMul29kiOi/b0hEKQBR+upjw/4VG0yuJBW4zTnV8GE9XGbX7dzIknf+R03/HRuFXXemJyPB0MJrUOBC1HDobaUvtDfjlhgbrjvLh0mGP2UWFGa6abPjMe1kWd8YDZCS1WYl5RsDLg=; X-YMail-OSG: 4rKtDkYVM1nvhbo8QZn5FS0mV4Qgr9BM18pMUf1SvtyW7WkOEq.DB0BG0fLXlrqlEtSlpD.fwt8vfPelByKI.Z1qcl9AASCxFqGWwr1tYrv90g57KFwYr5CiGUnEgr30s8YgffEmHAGZ.ZzOUB3ZJlKqrgA- Received: from [67.55.0.107] by web57403.mail.re1.yahoo.com via HTTP; Mon, 10 Nov 2008 11:20:17 EST Date: Mon, 10 Nov 2008 11:20:17 -0500 (EST) From: chloe K To: FreeBSD-Questions@FreeBSD.org In-Reply-To: <20081110151930.GB73102@Grumpy.DynDNS.org> MIME-Version: 1.0 Message-ID: <247079.34646.qm@web57403.mail.re1.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: hundred files to tar and untar X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 16:32:31 -0000 Thank you but I have hundred files in different folders and it may need 3 files in 100 files in this folder. I did put "need files" in file.txt and using tar zcvf file.tar.gz -T file.txt inside file.txt eg: /var/web/data/version/cc.html but don't know how to restore as restore directory is in different folder /var/web/data/cc.html thank you David Kelly wrote: On Mon, Nov 10, 2008 at 08:10:36AM -0500, chloe K wrote: > Hi > > I have hundred files to tar > > How can I make tar the file but untar in different folder? > > eg: > > tar cvf html.tar /var/web/data/verion/cc.html > > untar html.tar /var/web/data/root/cc.html > > Thank you RTFM. Specifically look at the -C option. Or you could do it the simple way (note parenthesis, the cd only applies within the parenthesis, when the command clompletes your shell is back to the original directory): (cd /var/web/data/verion/cc.html ; tar -cvf /html.tar * ) (cd /var/web/data/root/cc.html ; tar -xvf /html.tar ) The above does not store the path prefix in the tar archive, which is perhaps the problem you were trying to solve? -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad. _______________________________________________ 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" --------------------------------- Yahoo! Canada Toolbar : Search from anywhere on the web and bookmark your favourite sites. Download it now!