当前位置:网站首页>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
边栏推荐
- [leetcode] 28. Implement strstr ()
- Arrow parquet
- Compilation and operation of program
- “链”接无限可能:数字资产链,精彩马上来!
- Arrow 之 Parquet
- [advanced mathematics] [8] differential equation
- matlab----EEGLab查看脑电信号
- Hello, I'd like to ask questions about C and database operation.
- Online XML to JSON tool
- [today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
猜你喜欢
![[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay](/img/18/b06e2e5a2f76dc2da1c2374b8424b3.png)
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay

Leetcode-6129: number of all 0 subarrays

103. (cesium chapter) cesium honeycomb diagram (square)
![[today in history] July 7: release of C; Chrome OS came out;](/img/a6/3170080268a836f2e0973916d737dc.png)
[today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued

During the interview, I was asked how to remove the weight of MySQL, and who else wouldn't?

Remote monitoring solution of intelligent electronic boundary stake Nature Reserve
![Vulnhub | dc: 6 | [actual combat]](/img/7e/de7d5b56724bde5db2bb8338c35aa8.png)
Vulnhub | dc: 6 | [actual combat]

leetcode-6131:不可能得到的最短骰子序列
![[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now
![[today in history] July 17: Softbank acquired arm; The first email interruption; Wikimedia International Conference](/img/0f/8ce2d5487b16d38a152cfd3ab454bb.png)
[today in history] July 17: Softbank acquired arm; The first email interruption; Wikimedia International Conference
随机推荐
Introduction to several scenarios involving programming operation of Excel in SAP implementation project
Brush questions with binary tree (4)
Principle analysis of bootloader
Unity VS—— VS中默认调试为启动而不是附加到Unity调试
leetcode-155:最小栈
leetcode-6131:不可能得到的最短骰子序列
leetcode-6130:设计数字容器系统
[noi simulation] string matching (suffix automata Sam, Mo team, block)
Leetcode-6129: number of all 0 subarrays
Cloud native, Intel arch and cloud native secret computing three sig online sharing! See you today | issues 32-34
Vulnhub | dc: 5 | [actual combat]
MySQL 日期【加号/+】条件筛选问题
[today in history] July 13: the father of database passed away; Apple buys cups code; IBM chip Alliance
火山引擎项亮:机器学习与智能推荐平台多云部署解决方案正式发布
Technology cloud report: more than zero trust, the wild hope of Parra's "Digital Security Cloud strategy"
leetcode-6127:优质数对的数目
程序的编译和运行
雷达水位计的工作原理及安装维护注意事项
Online XML to JSON tool
Basic knowledge of Marine Geology