Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to transfer very large Files in Linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to transfer super-large files in Linux, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.

The main content of this paper is how to transfer large files under Linux, as follows.

File transfer under linux, we will first think of tools such as rsync, scp, but this kind of tools have a slow feature, because these tools are encrypted transmission, encryption at the sender, decryption at the receiver, when we transfer some non-sensitive files, we can transfer them directly on the network without encryption.

Directly on the example, transfer a 2077m ISO file.

Nc sends and receives data

Receiving end:

Nc-l 45.55.0.86 9999 > jieshou.iso

➤-l: listens to a port to receive data

➤-u: instead of using TCP, use UDP for data connection (it should be faster, no try)

The meaning of the whole command: open port 9999 locally to receive data and store the received data in the "jieshou.iso" file.

Sender:

Time nc 45.55.0.86 9999

< CentOS-6.9-x86_64-bin-DVD2.iso 命令最前面的time是用来检测该命令运行耗时的。

A 2077m file was uploaded on the public network in 24 seconds, and the average speed was as high as 87M/s. After the transfer, the MD5 was checked at both ends and found that the files were exactly the same.

There are two characteristics of nc transmission:

➤ is fast.

➤ transmission is simple, does not need to log on to the other server, does not need to verify information.

Nc progress display

If your file is too large and want to see the progress of the transfer, use PV

Yum install epel-release-yyum install pv-ycat CentOS-6.9-x86_64-bin-DVD2.iso | pv-b | nc 45.55.0.86 9999

Transfer directory

Receiving end:

Nc-l 45.55.0.86 9999 | pv-b > home.tar.gz

Sender:

Tar-czf-/ home/ | nc 45.55.0.86 9999

Transfer file

A, B, C three hosts, A USA, C Changnan, C can only access B, can not directly access A Magi B and AC interworking. How can C get the file on A?

Execute on C:

Nc-l 9999 > google_file.txt

Execute on B:

Nc-l 9999 | nc (public network IP of C) 9999

Execute on A:

Nc (B's public network IP) 9999 < google_file.txt Thank you for reading this article carefully. I hope the article "how to transfer large Files in Linux" shared by the editor will be helpful to you. At the same time, I hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report