Usable technology

Peter Kuhar

Simple file transfer

When you have to transfer a large amount of data from on computer to another you’ll find that simplicity rules. Using two basic tools that are on most linux machines ( works on windows with cygwin ) tar and netcat (nc). You don’t need any samba, http, ftp, rsync…
Here it goes:
On the receiving end:
$ nc -l -p 1234 | tar -x

This will make a tcp server listening on port 1234 and pass any received data to tar

On the sending end:
$ tar -c FolderToTransfer | nc receivershost 1234

This will create tar file on the fly and pass it to the server.

To enable compression use( only for slow networks, since it consumes a lot of CPU ): tar -xz and tar -cz

Leave a Reply

You must be logged in to post a comment.

http://www.pkuhar.com © 2006 Peter Kuhar peter@pkuhar.com