Linux scp command usage example summary

  
                

Under Linux, you need to implement file transfer between two servers. You can use the scp command. In Linux system, the usage of the scp command is simple and practical. The system home will introduce you how to use the scp command. File transfer between Linux servers.

scp is a secure copy of shorthand for remote command to copy files in Linux, and it is similar to the cp command there, but cp only copy in the machine can not be cross-server, and scp The transmission is encrypted. It may affect the speed slightly. When your server hard disk becomes read-only read only system, using scp can help you remove the file. In addition, scp is still very resource-intensive and does not increase the system load. At this point, rsync is far less than it. Although rsync is a bit faster than scp, when there are many small files, rsync will cause the hard disk I/O to be very high, and scp basically does not affect the normal use of the system.

1. Command format:

scp [parameter] [original path] [target path]

2. Command function:

scp is the abbreviation of secure copy, scp is a secure remote file copy command based on ssh login under linux system. The linux scp command can copy files and directories between linux servers.

3. Command parameters:

-1 Force the scp command to use the protocol ssh1

-2 Force the scp command to use the protocol ssh2

-4 Force the scp command to use only IPv4 addressing

-6 Force the scp command to use only IPv6 addressing

-B Use batch mode (transfer password or phrase is not asked during transmission)

-C Allow compression. (Provide the -C flag to ssh to turn on compression)

-p Keep the modification time, access time, and access rights of the original file.

-q Does not display the transfer progress bar.

-r Recursively copy the entire directory.

-v Shows the output in detail. Scp and ssh(1) will show debugging information for the entire process. This information is used to debug connections, verification and configuration issues.

-c cipher Encrypts the data transfer with cipher. This option is passed directly to ssh.

-F ssh_config Specifies an alternate ssh configuration file that is passed directly to ssh.

-i identity_file Reads the key file used for the transfer from the specified file. This parameter is passed directly to ssh.

-l limit Limits the bandwidth that the user can use, in Kbit/s.

-o ssh_option If you are used to using the parameter passing method in ssh_config(5),

-P port Note that the uppercase P, port is the port number used to specify the data transfer

-S program Specifies the program to use when encrypting transfers. This program must be able to understand the options of ssh(1).
Previous123Next page Total 3 pages

Copyright © Windows knowledge All Rights Reserved