2.4.24. scp#

scp copies files and directories between computers over SSH.

2.4.24.1. Common scp usage#

Using scp is helpful for copying single files or folders that aren’t too large. The general notation is similar to rsync:

scp -r [source] [destination]

The option, -r, allows you to copy folders (but this can be used with files regardless). Here are some examples:

scp file.txt van@pete.hpc.okstate.edu:/path/to/directory 
scp -r folder van@pete.hpc.okstate.edu:/path/to/directory 
scp -r van@pete.hpc.okstate.edu:/path/to/directory .

Recall that option, -r, is used for copying folders, but it can also copy files. The . means here, which assumes you are in the working directory where you need the file.