Secure Copy Protocol

Copy remote file to local host:

scp [email protected]:<remote_file> /some/local/directory

Copy local file to remote host:

scp <local_file> [email protected]:/some/remote/directory

Copy local directory to remote directory:

scp -r <local_dir> [email protected]:/some/remote/directory/<remote_dir>

Copy a file from one remote host to another:

scp your_username@<host1>:/some/remote/directory/foobar.txt your_username@<host2>:/some/remote/directory/

Last updated