file transfer with netcat

netcat lets you stream bytes over the network. When used with tar, you can transfer files and directories.

Say you have two computers — bam and boom — and you want to copy the ~/pictures/ directory from bam to boom.

First, on host boom:

netcat -l -q 0 -p 3000 | tar xzv

Second, on host bam:

tar czv ~/pictures/ | nc -q 0 boom 3000

Done.

Posted by pierre on 26 March 2009 in bash

Leave a Reply

*