[LBo] Re: Symlink peculiarities (Anerobe)

Brice Hunt shoalcreek5 at gmail.com
Mon Jan 8 21:53:20 CET 2007


Collin Park wrote:

> That's bizarre.  Could you snarf'n'barf (or copy/paste) the cmds used?
> I cannot get the "cp" command (I'm using SuSE 9.3) to actually copy a
> symlink; it seems to always copy the file.  This is the case even when
> I say "cp -p".

I can copy symlinks using cp -P and cp -d.  Just make sure that you are
using the upper-case "P" and not the lower case "p."  The lower case "p"
(as in "cp -p") is to preserve the copied file's mode, ownership, and
timestamp.  "-P" and "-d" tell cp to not dereference the pointer.  That
is programmer-speak that means copy the link itself and not the
file/folder to which the link points.


More information about the QnA mailing list