Last Updated: May 04, 2019
·
441
· ravi

Simple *nix file transfer

Not an idea of mine but might be of use: the nc (netcat) man page has a simple and clever example of how to accomplish ad hoc file transfer with a friend or coworker:


Start by using nc to listen on a specific port, with output captured into a file:

$ nc -l 1234 > filename.out

Using a second machine, connect to the listening nc process, feeding it the file which is to be transferred:

$ nc host.example.com 1234 < filename.in

After the file has been transferred, the connection will close automatically.