当前位置:网站首页>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-114:二叉树展开为链表
- If the order is not paid for 30 minutes, it will be automatically cancelled. How to achieve this? (Collection Edition)
- leetcode-919:完全二叉树插入器
- Wokerman custom write log file
- Why did I choose to become a network engineer after graduating from weak current for 3 months
- MPI学习笔记(二):矩阵相乘的两种实现方法
- 文件操作详解
- Leetcode-6127: number of high-quality pairs
- [today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
- Google guava is just a brother. What is the real king of caching? (glory Collection Edition)
猜你喜欢
![Vulnhub | dc: 5 | [actual combat]](/img/c6/34117bbfb83ebdf9e619f4e4590661.png)
Vulnhub | dc: 5 | [actual combat]

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

Myormframeworkjdbc review and problem analysis of user-defined persistence layer framework, and thought analysis of user-defined persistence layer framework

Go language go language built-in container

Leetcode-6130: designing digital container systems

移动web布局方法

Working principle of radar water level gauge and precautions for installation and maintenance

【高等数学】【5】定积分及应用

Docker builds redis cluster

雷达水位计的工作原理及安装维护注意事项
随机推荐
Scan delete folder problems
Question and answer 47: geeks have an appointment - the current monitoring system construction of CSC
Remote—基本原理介绍
476-82(322、64、2、46、62、114)
leetcode-6129:全 0 子数组的数目
【NOI模拟赛】字符串匹配(后缀自动机SAM,莫队,分块)
[workplace rules] it workplace rules | poor performance
PayPal PHP product trial period "recommended collection"
Step num problem
Leetcode-919: complete binary tree inserter
Vulnhub | dc: 6 | [actual combat]
leetcode-6125:相等行列对
Kubernetes advanced part learning notes
If the order is not paid for 30 minutes, it will be automatically cancelled. How to achieve this? (Collection Edition)
[advanced mathematics] [1] function, limit, continuity
Principle analysis of bootloader
Struct, enum type and union
leetcode-79:单词搜索
Hello, I'd like to ask questions about C and database operation.
Remote monitoring solution of intelligent electronic boundary stake Nature Reserve