Using nc to transfer large file

linux

Solution

On receiving end:

nc -l 1234 > file.tar.gz

On sending end:

cat file.tar.gz | nc <reciever's ip or hostname> 1234

That should work. Depending on the speed, it may take a while but both processes will finish when the transfer is done.

Problem

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.

Original source