View Single Post
  #4 (permalink)  
Old 01-15-2007, 01:07 PM
Robert Hull
Newsgroup Contributor
 
Posts: n/a
Re: cp command without symbolic links

On Friday 12 Jan 2007 19:40, noi <noi@siam.com> wrote in alt.os.linux:

> On Fri, 12 Jan 2007 11:16:43 -0800, davida wrote this:
>
>> What I want to do is copy files from one folder to another but not
>> create the destination files and folders without creating a symbolic
>> link to them.
>>
>> The reason why is that we want to create a test site without going
>> back to the live links.
>>
>> Any help would be appreciated.
>>
>> I've tried cp --copy-contents but that still keeps the symbolic links
>> intact.
>>
>> Thank you in advance.

>
> Wouldn't that be
>
> $ cp -d /folder /foldercopy


That would be the opposite of what the OP appears to want to do.

IIUC the OP wants all symlinks to be created as real files so (s)he
*does* want to dereference the links. The command would be either

cp -L /source /destination

or

cp --dereference /source /destination

depending on how much you want to type.
--
Robert HULL

Archival or publication of this article on any part of thisishull.net
is without consent and is in direct breach of the Data Protection Act
Reply With Quote

 
Old 01-15-2007, 01:07 PM