[SunHELP] cp -r & symlinks

Dale Ghent daleg at elemental.org
Wed Oct 9 00:22:43 CDT 2002


On Fri, 4 Oct 2002, Markham, Richard wrote:

| It appears that cp -r /cdrom/* will recurse through the cdrom0
| symlink as well as the directory it points to as well.  I did
| a seperate test by doing a cp -r /cdrom/cdrom0, hoping it would
| only copy the link and not follow it, but it copied the target as
| well.  Is there anyway I can get cp to recurse without following
| symlinks?

No. Use tar instead.

tar cf - /cdrom | (cd /destination && tar xf -)

/dale



More information about the SunHELP mailing list