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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi there! We are using sun solaris 2

Status
Not open for further replies.

ganeshmb

Programmer
Dec 5, 2001
32
US
Hi there!
We are using sun solaris based version of unix. We use the command cp -R to copy directory. But the problem is that, if there is a softlink in the source directory it copies all the contents of the softlink to the target directory rather than the softlink itself. We need some help as to how to copy the softlink rather than the content of the softlink. Is any script available for recursive directory copy retaining all soft links in the same form?

Thanks in advance,
Ganesh
 
Ganesh:

You can use tar or cpio to do your copy; They leave the soft links intact. This command:

cd /usr/eds; tar cf - .|(cd /usr/fred; tar xf - )


copies everything from /usr/eds directory to /usr/fred directory.


Here's the cpio version:

Regards,


Ed
cd /usr/eds; find . -depth -print|cpio -pd /usr/fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top