This page looks best with JavaScript enabled

Securely transfer files between two Unix PCs with scp

 ·  ☕ 1 min read

scp utility allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Usage

  • Copy the specific file from a remote host to the local host:

    scp [email protected]:/path/to/<file> /path/to/local/directory 
    
  • Copy the specific file(s) from the local host to a remote host:

    scp <file> [email protected]:/path/to/remote/directory 
    
  • Copy the specific directory from the local host to a remote host:

    scp -r <file> [email protected]:/path/to/remote/directory 
    
  • Copy the specific file from a one remote host to another:

    scp [email protected]:/path/to/remote/directory/<file> [email protected]:/path/to/remote/directory/
    
  • Copy multiple files from the local host to a remote host:

    scp <file1> <file2> <fileN> [email protected]:/path/to/remote/directory 
    
  • Copy the multiple files from a remote host to the local host:

    scp [email protected]:/path/to/\{<file1>,<file2>,<fileN>\} /path/to/local/directory
    

Read more

Check out the manual page to read more about scp:

man scp
What's on this Page