Deprecation warning: scp is deprecated, because “the scp protocol outdated, inflexible, and not readily fixed”.
Please consider using rsync instead. Read more about rsync.
- Source 1: Call for testing: OpenSSH 8.0.
- Source 2: Deprecating SCP.
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