Geek Essential Objectively finite, subjectively infinite.

23Aug/110

scp, another way to copy…

This is somewhat obvious, but when moving files from a server to a server, security should be one concern. So you use scp. It's a simple copy tool that uses SSH to transfer data between two computers.

Simply, it works similarly the way that cp works, except that you need to indicate login credential and remote server name.

So to copy files from remote server to current server, a syntax would look something like ...

#scp remote_user@remote_server:/remote/directory/some_file /local/directory/

And to copy files from local to remote, it would look like ....

#scp /local/directory/somefile remote_user@remote_server:/remote/directory/

You can also use options like -r to copy directories as well.

#scp -r remote_user@remote_server:/remote/directory /local/directory

There are other options you can easily find from man pages...