Here's an example of how to copy a file from a local computer to a location on a remote server:
scp index.php user@web2.websites.com:/mysite.com/httpdocs/index.php
Here's an example of how to copy a whole directory from a local computer to a remote server:
scp -r httpdocs/. user@web2.websites.com:/mysite.com/httpdocs/.
Notice the slash dot thing at the end of the directory name. That's so that everything under that directory gets moved. If you don't use the slash dot after the directory name you will end up with the directory inside the other directory (like /mysite.com/httpdocs/httpodocs/...) which is clearly not what I want.
The -r stands for recursive.
Of course, you can find more details about other options that go with scp by typing
man scp
at a linux-ish or unix-ish command prompt.
No comments:
Post a Comment