Putty copy and paste


#1

Need to be able to copy files from domain folder to an other.

I have tried:
cp -r domain-name1.com domain-name2.com

also tried
cp -r --copy-contents domain-name1.com domain-name2.com

both with the same result of copying the domain-name1.com directory and sub-folder and files in the sub-folders into the the target directory.

However it did not copy the files in the main domain-name1.com folder.

Anyone know the correct way to copy the contents of a folder into an other folder without getting the main source folder stuffed into the target folder?


#2

The correct syntax is cp -R folder1 folder2
Note the upper case ‘R’ :wink:


#3

so you’re getting everything from domain-name1.com/ copied to domain-name2.com/domain-name1.com/? well that’s what you asked it to do :wink:

try this:

cp -r domain-name1.com/* domain-name2.com/

that will say to copy everything in domain-name1.com/ to domain-name2.com/, instead of copying domain-name1.com to domain-name2.com/

track7 - my dream-hosted site


#4

-R is more widely accepted, but -r works for me on dreamhost as well as my own linux systems.

track7 - my dream-hosted site


#5

Errr yah. I didn’t quite understand the OP’s problem I believe, heh. I thought (originally) they were just running the command wrong, as I understood it, their sub-directories weren’t being copied properly. So I figured using the generic syntax might work to resolve any typo’s or such.

Ah well… back to coffee :stuck_out_tongue:


#6

Thank you guys !

Exactly what I needed :slight_smile: