Skip site navigation (1)Skip section navigation (2)
Date:      01 Oct 2002 15:16:58 -0700
From:      swear@attbi.com (Gary W. Swearingen)
To:        Erik Trulsson <ertr1013@student.uu.se>
Cc:        Dan Nelson <dnelson@allantgroup.com>, Beech Rintoul <akbeech@anchoragerescue.org>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Copying directories contents
Message-ID:  <791y79x0rp.y79@localhost.localdomain>
In-Reply-To: <20021001180346.GA39309@falcon.midgard.homeip.net>
References:  <200210010955.35018.akbeech@anchoragerescue.org> <20021001175837.GF7147@dan.emsphone.com> <20021001180346.GA39309@falcon.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Erik Trulsson <ertr1013@student.uu.se> writes:

> > tar cf - user1 user2 user3 user4 | ( cd /destination ; tar xpf - )
> 
> To avoid starting an extra shell process you can also do:
> 
> tar cf - user1 user2 user3 user4 | tar xpf - -C /destination

Or, if you believe the manual which says -C is "probably untrustworthy"
or want better portability, you could use to do the same:

tar cf - user1 user2 user3 user4 | { cd /destination ; tar xpf - }

> "cp -r" won't work well with symlinks. ("cp" will copy the file the
> symlink points to, while tar will make a new symlink in the destination
> directory.)

But "cp -R" works well with symlinks.  There might be other problems.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?791y79x0rp.y79>