Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send a file using netcat and then keep the connection alive?

I am issuing the command:

netcat serveraddress myport < MY_FILE

The thing is, that netcat sends a message to close the connection once the file is sent. I need to write messages from the console after sending that file. I remember to have done something to pipileline to stdin.. was it this?

netcat serveraddress myport < MY_FILE | 

That isn't working now.

I'm on unix.

Extra info: This did not assume control on server side (E.G. use netcat on serverside to listen for the inbound connection)

like image 464
quinestor Avatar asked Sep 04 '12 16:09

quinestor


1 Answers

Perhaps you were doing:

cat MY_FILE - | ncat ...

(Note that I've intentionally mispelled netcat, because I believe ncat is a superior program.)

like image 187
William Pursell Avatar answered Oct 21 '22 16:10

William Pursell