Sending file over netcat, without closing connection afterwards

cat myFile - | nc 127.0.0.1 1234

cat will echo the file to stdout, which will cause nc to pick it up and send it. We add the ‘-‘ to cat, to keep it reading from stdin, which will cause nc to keep the connection alive, because it expects more data to be sent.