scp
is the command used on Linux and Unix systems to securely copy files and directories. It uses the SSH protocol for encrypted transmission. The following is scp
the basic syntax and example usage of the command:
-
Copy files from remote host to local:
scp 用户名@远程主机:源文件路径 目标路径
Example:
scp [email protected]:/path/to/file.txt /local/path/file.txt
-
Copy files from local to remote host:
scp 源文件路径 用户名@远程主机:目标路径
Example:
scp /local/path/file.txt [email protected]:/path/to/file.txt
-
To copy a directory and its contents recursively:
scp -r 用户名@远程主机:源目录路径 目标路径
Example:
scp -r [email protected]:/path/to/directory /local/path/directory
These are scp
the basic usage of the command, you can adjust accordingly according to your needs. You can also use the command to view detailed instructions and other options for the command man scp
in the terminal .scp