Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recursive cp that preserves symbolic links

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
CA
Hi there,

I am fairly new to Unix and I can't seem to find an answer online for this.

Is there a way to do a cp -Rd on a unix?
Basically, I need to copy over a folder that contains regular files/folders and also symbolic links in it.

I need to preserve the symbolic links in the target folder, but it looks like the -R option specified in linux makes it follow all links .... is there a way around this ?

Thanks!
 
You could tar up the folder and possibly use the -h option to follow the symbolic links and include them in the tarball.

I want to be good, is that not enough?
 
I used to visit bsdforums.org back in the day quite a bit but the site seems to be down at the moment... They always had a really good support base but maybe forums.freebsd.org are taking over?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top