<>1. background

As a back-end development or operation and maintenance engineer , Server is a technology we must firmly grasp . In this section, we mainly explore ContOS7 The usage and example of remote copy file under .

Speaking of CentOS Copy in , What we use most often is cp Yes , The format is cp Source directory or file Target directory or file .

Examples , We will use the /home/test.txt copy to /tmp lower : cp /home/test.txt /tmp.

of course , This is not the protagonist we're going to talk about today , Our main character today is scp Remote copy command , This is quite convenient to copy between servers in a LAN .

<>2. Examples

scp [ Optional parameters ] [[user@]host1:]file1 [...] [[user@]host2:]file2 perhaps scp [ Optional parameters ]
file_source file_target

Copy files from local to remote server
scp local_file remote_username@remote_ip:remote_folder perhaps scp local_file
remote_username@remote_ip:remote_file perhaps scp local_file remote_ip:remote_folder
perhaps scp local_file remote_ip:remote_file
* The first 1,2 The user name is specified , After the command is executed, you need to enter the password again
* The first 3,4 There are no user names specified , The user name and password are required after the command is executed
* The first 1 Remote only directories specified , The file name remains unchanged
* The first 2 File name specified
* The first 3 Remote only directories specified , The file name remains unchanged
* The first 4 File name specified

Local and Two servers , I need to put 50 Server /home/test.txt File copy to 51 Of /tmp
Under the table of contents .
scp /home/test.txt root@ The execution order is as follows Execute the view command as follows

©2020 ioDraw All rights reserved
LeetCode quick get start ① —— Array series ( Often asked in an interview , Suggested collection ) Apple iPhone 12 Price leakage : The official highest price is close to 1 Ten thousand yuan ( Essence )2020 year 6 month 26 day C# Class library Ip Address help class spark.sql.shuffle.partitions and spark.default.parallelism The difference between flutter study -- Search box NVIDIA official apology : Robots are sold out RTX 3080django Do not close CSRF middleware , Custom through CSRF Tested post request 【 Deep learning 】 Target detection in progress IOU The concept and calculation of ( Essence )2020 year 6 month 26 day C# Class library DataTable( Extension method ) Can Huawei Hongmeng system and Android , Apples compete against each other ?