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!

Copy directory structure

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
Good day ..

I need to copy everthing from /ar0402cu/primary (where there are multiple files and other directorys to:

/datamap/secondary/.

Looking for any assistance on what the command would be.

Thanks.
 
cd /ar0402cu/primary
cp -pR * /datamap/secondary

if you want to retain the /ar0402cu/primary part of the path, don't cd into the directory. The -p retains the ownership and datestamp of the files and the R does a recursive copy.
 
Hi. I would use this command. Do a man on cpio to understand the switches. These commands also retain file mod times, permissions, ownerships and symbolic links I believe.

cd /ar0402cu/primary
find . -depth | cpio -pudm /datamap/secondary/

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top