Netcat is like a swiss army knife for geeks. It can be used for just about anything involving TCP or UDP. One of its most practical uses is to transfer files. Non *nix people usually don't have SSH setup, and it is much faster to transfer stuff with netcat then setup SSH. netcat is just a single executable, and works across all platforms (Windows,Mac OS X, Linux).
On the receiving (destination) terminal, run:
nc -l -p 1234 > out.file
For mac users, use
nc -l 1234 > out.file
This will begin listening incomming data on port 1234.
On the sending terminal, run:
nc -w 3 [destination ip address] 1234 < out.file
will connect to the receiver and begin sending file.
The -w 3
option stands for a 3 seconds timeout.
http://nakkaya.com/2009/04/15/using-netcat-for-file-transfers/
what if you want to tranfer multiple files and you the filesystem is write protected how can one download all the file recursively ?