Transfer files fast between servers using netcat and tar

This is a short post on how you can transfer files unsecured but fast between linux servers. I prefer to use netcat (nc) to transfer large amounts of data between servers when I know the connection between them are secure, ie on my private LAN.

The sender server should run the following command

$ tar cf - folder | netcat 192.168.0.1 9000

and the receiveing server should listen with with this command

$ netcat -l -p 9000 | tar x