From WikiOD

Syntax[edit | edit source]

  • scp [-rv] [-i identity_file] [[user@]host1:]file1 ... [[user@]host2:]file2

Basic Usage[edit | edit source]

# Copy remote file to local dir
scp /local/dest

# Copy local file to remote dir

# Key files can be used (just like ssh)
scp -i my_key.pem

Secure Copy[edit | edit source]

scp command is used to securely copy a file to or from a remote destination. If the file is in current working directly only filename is sufficient else full path is required which included the remote hostname e.g.

Copy local file in your CWD to new directory[edit | edit source]

scp localfile.txt /home/friend/share/

Copy remote file to you current working directory[edit | edit source]

scp ./

Copy file from one remote location to another remote location[edit | edit source]


To copy directory and sub-directories use '-r' recursive option to scp[edit | edit source]

scp -r user@* ./workspace/