In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the use of linux's scp command to copy files remotely, I believe most people do not know much about it, so share this article for you to learn. I hope you will learn a lot after reading this article. Let's go and learn the method together.
Scp is the abbreviation of secure copy, and scp is a secure remote file copy command based on ssh login in linux system. Linux's scp command copies files and directories between linux servers. The 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. It may affect the speed slightly.
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 format: scp [parameters] [file]
Common parameters:
-1 using ssh protocol version 1-2-2 using ssh protocol version 2-4 using ipv4-6 using ipv6-B to run in batch mode-C using compression-F to specify ssh configuration file-l specify broadband limit-o specify ssh option used-P specify the port number of the remote host-p last modification time of the file, last access time and permission mode-Q does not show replication progress-r replicate recursively
Reference example
Copy files remotely to the local directory:
[root@linuxcool ~] # scp root@192.168.10.10:/opt/soft/rhel-server-7.3-x86_64.tar.gz / opt/soft/
Copy the directory from remotely to local:
[root@linuxcool] # scp-r root@10.10.10.10:/opt/soft/mysql / opt/soft/
Upload local files to the specified directory on the remote machine:
[root@linuxcool ~] # scp / opt/soft/rhel-server-7.3-x86_64.tar.gz root@192.168.10.10:/opt/soft/scptest
Upload the local directory to the specified directory on the remote machine:
[root@linuxcool] # scp-r / opt/soft/mysql root@192.168.10.10:/opt/soft/scptest
Keep the last modification time, last access time and permission mode of the file:
[root@linuxcool ~] # scp-p / root/install.log root@192.168.10.10:/tmp above is all the contents of the remote copy file using linux's scp command, 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.