Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using nc to transfer large file [closed]

Tags:

linux

I have a compressed file size of about 9.5 GB and want to transfer from one server to another server, I tried to use like the below,

server2:

nc -lp 1234 > file.tar.gz

server1:

nc -w 1 1234 < file.tar.gz

its not working.

I tried so many ways.

One machine is CentOS 6.4 and the other one is Ubuntu 12.04 LTS

Thanks in advance.

like image 968
Gopala Krishnan Avatar asked Jul 22 '13 21:07

Gopala Krishnan


People also ask

How do I transfer a nc file?

First, create a sample file. txt on the sender host. Next, you will need to run the nc command on the receiver host from where you want to receive the file. This command will instruct nc to listen for incoming requests on port 8585 until it receives a request.

How do you send documents through NCAT?

A basic file transfer is very simple: Start Ncat in listen mode on one end, start Ncat in connect mode on the other end, and pipe the file over the connection. There are two ways to do this that differ only in which end listens, the sender or the receiver.


1 Answers

from the sender

nc -v -w 30 1337 - l < filename

where "-v" from verbose, "-w 30" for a wait before and after 30 sec for the connection, "1337" port number, "-l" tell nc that this is a sender

from the receiver nc -v -w 2 ip_add_of_sender 1337 > filename

like image 160
yash anand Avatar answered Sep 22 '22 06:09

yash anand