SCP is similar to the normal file copy command CP, and the biggest difference between them is that the source or destination file of the SCP command is a remote file.
Command format
SCP [Options] [[user@]host1:]file1 ... [[User@]host2:] file2
Command parameters
-1
Force SCP to use protocol 1.
-2
Force SCP to use protocol 2.
-4
Force SCP to use only IPV4 addresses.
-6
Force SCP to use only IPV6 addresses.
-B
Select the batch mode.
-C
Allow compression.
-C cipher
Select cipher to encrypt the transmitted data. This option is passed directly to SSH (1).
-F Ssh_config
Specify an optional user profile for SSH. This option is passed directly to SSH (1).
-L Limit
Limits the transmission bandwidth, in units of kbit/s.
-O ssh_option
You can pass options in ssh_config configuration format to SSH.
-P Port
Specifies the port to connect to the remote host.
-P
Preserves the original file's modification time, last access time, and permission mode.
-Q
Quiet mode, ignoring warning and diagnostic information from SSH.
-R
Recursively copies the entire directory.
-S Program
Specifies the encryption program. The program must be able to understand the options for SSH (1).
-V
Redundancy mode, which prints debug information in the program.
Instance
A) Copy the redis/redis-3.0.4.tar.gz from the sugar user's home directory from the remote host 192.168.1.88 to the current directory.
SCP [email protected]:~/redis/redis-3.0.4.tar.gz. [email protected] ' s password:redis-3.0.4.tar.gz 100% 1333KB 1.3mb/s ls-l redis-3.0.4.tar.gz - rw-rw-r--1 Huey Huey 1364993 OCT 11:59 redis-3.0.4.tar.gz
Linux command-SCP: remote file copy