In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the linux file transfer way what the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that you read this linux file transfer way which articles will have a harvest, let's take a look at it.
1. Scp
[advantages] simple, convenient, safe and reliable; support speed limit parameters
[disadvantages] excluding directories is not supported
[usage]
Scp is secure copy, which is used to copy files remotely. Data transmission uses ssh, and uses the same authentication method as ssh, providing the same security guarantee.
Command format:
Scp [parameters]:: for example: scp / home/work/source.txt work@192.168.0.10:/home/work/ # copy the local source.txt file to the / home/work directory on the 192.168.0.10 machine scp work@192.168.0.10:/home/work/source.txt / home/work/ # copy the source.txt file on the 192.168.0.10 machine to the local / home / work directory scp work@192.168.0.10:/home/work/source.txt work@192.168.0.11:/home/work/ # copy the source.txt file on the 192.168.0.10 machine to the scp-r / home/work/sourcedir work@192.168.0.10:/home/work/ # copy folder under the / home/work directory of the 192.168.0.11 machine Add-r parameter scp-r / home/work/sourcedir work@www.myhost.com:/home/work/ # to display details using hostname scp-r-v / home/work/sourcedir work@www.myhost.com:/home/work/ #, plus-v parameter
2. Rcp
[Overview]
The target host needs to turn on the rcp function in advance and set the permission of rcp: add the source host to the list of trusted hosts, otherwise you cannot remotely copy files to the target host using rcp on the source host.
3. Wget
[advantages] simple and convenient, support excluding directories, support speed limit parameters
[disadvantages] files or folders can only be downloaded locally from a remote machine, and the remote machine needs to support ftp services (such as starting proftpd); there are many parameters, which are more complex to use than scp
[usage]
Wget is a free tool for automatically downloading files from the network. It supports downloading through the three most common tcp/ip protocols, http, https, and ftp, and can use the http agent.
Command format:
Wget [parameters] ftp:/// # proftpd format
For example:
Wget ftp://192.168.0.10//home/work/source.txt # copy folder source.txt wget ftp://www.myhost.com//home/work/source.txt # from 192.168.0.10 specify the local save path using the hostname wget-nh-p / home/work/ ftp://www.myhost.com//home/work/source.txt # and use the parameter "- p path" or "--directory-prefix= path" -nh,-- no-host-directories does not create a host directory wget-r-l 0-nh-p / home/work/ ftp://www.myhost.com//home/work/sourcedir # to download the sourcedir directory recursively, using the parameter-r; parameter-l,-level=number maximum recursive depth (inf or 0 represents infinity). Wget-- cut-dirs=3-r-l 0-nh-p / home/work/ ftp://www.myhost.com//home/work/sourcedir #-Parameter-cut-dirs=number ignores the number layer remote directory, in this case the sourcedir directory on myhost is saved to the local work directory. Wget-- limit-rate=200k-- cut-dirs=3-r-l 0-nh-p / home/work/ ftp://www.myhost.com//home/work/sourcedir #-Parameter-limit-rate=rate limits download throughput wget-- limit-rate=200k-- cut-dirs=3-r-l 0-nh-p / home/work/-x / home/work/sourcedir/notincludedir ftp://www.myhost.com//home/work/sourcedir # excludes path use-x parameter The number wget-Q-- limit-rate=200k-- cut-dirs=3-r-l 0-nh-p / home/work/-x / home/work/sourcedir/notincludedir ftp://www.myhost.com//home/work/sourcedir # parameter-Q indicates quiet mode No output Default is-v, redundancy mode
4. Rsync
[advantages] powerful, operation similar to scp, support excluding directories, support speed limit parameters, and also support local replication.
[shortcomings] not for the time being
[usage]
Rsync is a data mirror backup tool under a unix-like system, which can be seen from the name of the software-remote sync. It operates in a manner similar to that of scp and, but is much more powerful than scp. When using double colons to separate hostnames and file paths, you are using the rsync server, which is not covered here.
Command format:
Rsync [parameters]:
For example:
Rsync / home/work/source.txt work@192.168.0.10:/home/work/ # copy the local source.txt file to the / home/work directory on the 192.168.0.10 machine rsync work@192.168.0.10:/home/work/source.txt / home/work/ # copy the source.txt file on the 192.168.0.10 machine to the local / home/work directory rsync work@192.168.0 .10: / home/work/source.txt work@192.168.0.11:/home/work/ # copy the source.txt file on the 192.168.0.10 machine to the rsync-r / home/work/sourcedir work@192.168.0.10:/home/work/ # copy folder under the / home/work directory on the 192.168.0.11 machine Add-r parameter rsync-r / home/work/sourcedir work@www.myhost.com:/home/work/ # to display details using hostname rsync-r-v / home/work/sourcedir work@www.myhost.com:/home/work/ #, add-v parameter rsync-r-v-- exclude sourcedir/notinclude / home/work/sourcedir work@www.myhost.com:/home/work/ # to exclude subdirectories, note:-- the path after exclude cannot be an absolute path It must be a relative path, otherwise it will not be excluded if it does not match. This is the end of the article on "what are the ways linux transfers files?" Thank you for your reading! I believe you all have a certain understanding of the knowledge of "what are the ways in which linux transfers files?". If you want to learn more, you are 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.