In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of the scp command in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Linux commonly used command scp command is used to copy files remotely under Linux. Similar commands are cp, but cp is only copied locally, not across servers, and the scp transfer is encrypted.
Copy files between the local host and the remote host by scp encryption
Add that when your server hard drive becomes read-only read only system, using scp can help you move the files out. In addition, scp is also very resource-free, will not increase the system load, at this point, rsync is far less than it. Although rsync is a little faster than scp, when there are a large number of small files, rsync will cause the hard disk I _ An O to be very high, while scp basically does not affect the normal use of the system.
Syntax scp (options) (parameters) option-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: specify ssh configuration file -i:identity_file reads the key file used for transfer from the specified file (for example, Amazon Cloud pem). This parameter is passed directly to ssh;-l: specify the broadband limit;-o: specify the ssh option used;-P: specify the port number of the remote host;-p: keep the last modification time of the file, last access time and permission mode;-Q: do not display replication progress -r: copy recursively. Parameter source file: specifies the source file to copy.
Target file: target file. The format is user@host:filename (the file name is the name of the target file).
The scp command copied from the remote to the local instance is the same as the above command, as long as the two parameters after the local-to-remote command are swapped.
Copy files from a remote machine to a local directory
Scp root@10.10.10.10:/opt/soft/nginx-0.5.38.tar.gz / opt/soft/ downloads the nginx-0.5.38.tar.gz file from the / opt/soft/ directory on the 10.10.10.10 machine to the local / opt/soft/ directory.
Copy OpenVPN from Amazon cloud to local directory
Scp-I amazon.pem ubuntu@10.10.10.10:/usr/local/openvpn_as/etc/exe/openvpn-connect-2.1.3.110.dmg openvpn-connect-2.1.3.110.dmg downloads the openvpn installation file from the 10.10.10.10 machine to the local current directory.
Copy from a remote machine to a local
Scp-r root@10.10.10.10:/opt/soft/mongodb / opt/soft/ download the mongodb directory from / opt/soft/ on the 10.10.10.10 machine to the local / opt/soft/ directory.
Upload local files to the specified directory on the remote machine
Scp / opt/soft/nginx-0.5.38.tar.gz root@10.10.10.10:/opt/soft/scptest # specifies port 2222 scp-rp-P 2222 / opt/soft/nginx-0.5.38.tar.gz root@10.10.10.10:/opt/soft/scptest to copy the file nginx-0.5.38.tar.gz from the local / opt/soft/ directory to the opt/soft/scptest directory of the remote machine 10.10.10.10.
Upload the local directory to the specified directory on the remote machine
Scp-r / opt/soft/mongodb root@10.10.10.10:/opt/soft/scptest upload the local directory / opt/soft/mongodb to the directory of / opt/soft/scptest on remote machine 10.10.10.10.
The above is all the content of the article "what is the use of scp commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.