I’m not sure why but I always need to look up the syntax of the ‘scp’ command when I go to use it. Maybe it’s because I don’t use it enough on a regular basis. But regardless of the reason, this is how it’s used:

scp current_location.txt new_directory

Well, that’s the gist of it, but the whole idea is to transfer files/directories between systems. Logged in on server1, transfer a file to server2:

scp file.txt username@server2:/exising_directory

Or vice versa (logged in on server2 and transferring a file from server1):

scp username@server1:/path/to/file.txt /path/to/existing_directory

Or now let’s say you want to copy an entire directory. Just use -r:

scp -r whole_directory username@server2:/path/to/place/directory

And to specify a port, just use ‘-P number.

Categories: Uncategorized

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.