当前位置:网站首页>A detailed explanation of SCP command
A detailed explanation of SCP command
2022-07-25 20:41:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
scp
The file is copied between the local host and the remote host by encryption
Additional explanation
scp command Used in Linux Under the command to copy files remotely , Similar orders are cp, however cp It's just that copying on the local machine can't cross servers , and scp The transmission is encrypted . It may affect the speed a little . When your server hard disk becomes read-only read only system when , use scp I can help you move the files out . in addition ,scp It doesn't take up resources , It will not increase the system load much , At this point ,rsync It's far less than that . although rsync Than scp It will be faster , But when there are lots of small files ,rsync It will cause the hard disk I/O Very high , and scp Basically does not affect the normal use of the system .
grammar
scp( Options )( Parameters )Options
-1: Use ssh Protocol version 1;
-2: Use ssh Protocol version 2;
-4: Use ipv4;
-6: Use ipv6;
-B: Run in batch mode ;
-C: Use compression ;
-F: Appoint ssh The configuration file ;
-i:identity_file The key file used to read the transfer from the specified file ( For example, Amazon cloud pem), This parameter is passed directly to ssh;
-l: Specify broadband restrictions ;
-o: Designated to use ssh Options ;
-P: Specify the port number of the remote host ;
-p: Last modification time of reserved file , Last access time and permission mode ;
-q: Don't show replication progress ;
-r: Copy... Recursively .Parameters
- Source file : Specify the source file to copy .
- Target file : Target file . The format is
[email protected]:filename( The file name is the name of the target file ).
example
From remote replication to local scp The order is the same as the one above , Just copy the local command to the remote command 2 One parameter exchange order is enough .
Copy files from a remote machine to a local directory
scp [email protected]:/opt/soft/nginx-0.5.38.tar.gz /opt/soft/ from 10.10.10.10 On the machine /opt/soft/ Download... From the directory nginx-0.5.38.tar.gz File to local /opt/soft/ Directory .
Copy from Amazon cloud OpenV** Go to the local directory
scp -i amazon.pem [email protected]:/usr/local/openvpn_as/etc/exe/openvpn-connect-2.1.3.110.dmg openvpn-connect-2.1.3.110.dmgfrom 10.10.10.10 Download from the machine openvpn Install files to the current local directory .
Copy from remote machine to local machine
scp -r [email protected]:/opt/soft/mongodb /opt/soft/ from 10.10.10.10 On the machine /opt/soft/ Download mongodb Directory to local /opt/soft/ Catalog to .
Upload the local file to the specified directory of the remote machine
scp /opt/soft/nginx-0.5.38.tar.gz [email protected]:/opt/soft/scptest
# Designated port 2222
scp -rp -P 2222 /opt/soft/nginx-0.5.38.tar.gz [email protected]:/opt/soft/scptest Copy local /opt/soft/ A file in a directory nginx-0.5.38.tar.gz To a remote machine 10.10.10.10 Of opt/soft/scptest Catalog .
Upload the local directory to the specified directory of the remote machine
scp -r /opt/soft/mongodb [email protected]:/opt/soft/scptest Upload local directory /opt/soft/mongodb To a remote machine 10.10.10.10 On /opt/soft/scptest Go to the directory of .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/111537.html Link to the original text :https://javaforall.cn
边栏推荐
- Why did I choose to become a network engineer after graduating from weak current for 3 months
- Leetcode customs clearance: hash table six, this is really a little simple
- “链”接无限可能:数字资产链,精彩马上来!
- [matlab] download originality documents based on oil monkey script and MATLAB
- Illustration leetcode - 3. longest substring without repeated characters (difficulty: medium)
- Compilation and operation of program
- During the interview, I was asked how to remove the weight of MySQL, and who else wouldn't?
- [today in history] July 19: the father of IMAP agreement was born; Project kotlin made a public appearance; New breakthroughs in CT imaging
- Introduction to MySQL engine and InnoDB logical storage structure
- IEC61131 address representation
猜你喜欢

Network protocol: TCP part2
![[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born](/img/bf/09ccf36caec099098a22f0e8b670bd.png)
[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born

Recommended books | essentials of industrial digital transformation: methods and Practice

数据库清空表数据并让主键从1开始

leetcode-6127:优质数对的数目
![[today in history] July 15: Mozilla foundation was officially established; The first operation of Enigma cipher machine; Nintendo launches FC game console](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 15: Mozilla foundation was officially established; The first operation of Enigma cipher machine; Nintendo launches FC game console

Cloud native, Intel arch and cloud native secret computing three sig online sharing! See you today | issues 32-34

How to choose a microservice registration center?
![Vulnhub | dc: 6 | [actual combat]](/img/7e/de7d5b56724bde5db2bb8338c35aa8.png)
Vulnhub | dc: 6 | [actual combat]
![[today in history] June 29: SGI and MIPS merged; Microsoft acquires PowerPoint developer; News corporation sells MySpace](/img/86/abeb82927803712a98d2018421c3a7.png)
[today in history] June 29: SGI and MIPS merged; Microsoft acquires PowerPoint developer; News corporation sells MySpace
随机推荐
How much memory does bitmap occupy in the development of IM instant messaging?
leetcode-6131:不可能得到的最短骰子序列
MySQL master-slave replication data synchronization, summary of common problems
How to realize reliable transmission with UDP?
Chapter VI modified specification (SPEC) class
Myormframeworkjdbc review and problem analysis of user-defined persistence layer framework, and thought analysis of user-defined persistence layer framework
JMeter - interface test
Force deduction ----- calculate the money of the force deduction bank
Arrow 之 Parquet
从底层结构开始学习FPGA(16)----PLL/MMCM IP的定制与测试
leetcode-79:单词搜索
[advanced mathematics] [5] definite integral and its application
test
Why did I choose to become a network engineer after graduating from weak current for 3 months
Leetcode-6131: the shortest dice sequence impossible to get
Leetcode-79: word search
[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
[tensorrt] dynamic batch reasoning
Follow up of Arlo's thinking
Recommend a website that converts curl commands into PHP code & a website that initiates and executes curl requests online