Transferring files between two computers using tar and network copy

You want to transfer a whole subdirectory from one unix-based machine to another and you want to save time by untarring WHILE the transfer is happening.

1. Establish a listener on the target machine. Here, netcat will listen (that's the -l) on the port specified (e.g. 5000), piping the output to an expanding tar process:

nc -l -w <idle-timeout-secs> <port>  | tar xvf -

2. fire off the transfer from the source machine.
tar cf - <directory> | nc <destination-host> <port>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License