Click to See Complete Forum and Search --> : Question about cp


Gotenks
03-06-2001, 06:14 PM
Greetings,

Though this is a simple question, and I've read the man page a few times over. I'd like to double check and run this by you guys so I dont get a boot to the head from my boss if I'm wrong.

I'm wanting to recursivly copy everything in a certain directory to another location. Would the following do the trick without breaking anything?

cp -rdp /home/httpd/someplace.net/local/ /httpd/anotherplace.com/local/

The source stuff is in /home/httpd/someplace.net/local/

And the target is
/httpd/anotherplace.com/local/

Yes, both directories exist. :D

Thanks,
Gotenks

jlany
03-06-2001, 06:54 PM
cp -rdp /home/httpd/someplace.net/local/ /httpd/anotherplace.com/local/

The source stuff is in /home/httpd/someplace.net/local/

And the target is
/httpd/anotherplace.com/local/

Yes, both directories exist. :D

Thanks,
Gotenks[/b]<HR></blockquote>

Hello!
the command 'cp -dpR /home/httpd/someplace.net/local/ /httpd/anotherplace.com/local/' would be more correct. Also, "cp -a /home/httpd/someplace.net/local/ /httpd/anotherplace.com/local/' would do exactly the same. Just tried both ways and nothing broke. ;)
Also, just make sure you have write permissions to the destination directory/folder.

[ 06 March 2001: Message edited by: jlany ]