Date: Mon, 10 Nov 2008 11:20:17 -0500 (EST) From: chloe K <chloekcy2000@yahoo.ca> To: FreeBSD-Questions@FreeBSD.org Subject: Re: hundred files to tar and untar Message-ID: <247079.34646.qm@web57403.mail.re1.yahoo.com> In-Reply-To: <20081110151930.GB73102@Grumpy.DynDNS.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <dkelly@hiwaay.net> 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!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?247079.34646.qm>