0

I want to connect to a remote a server using netcat (or something similar), send a string which I want to echo from command-line, and then want to keep connection open. I tried different variation of piping echo or cat to netcat, but none worked. How can I achieve the same on Ubuntu 16.04, 64 bit?

1
  • ".... and then I want to keep the connection open". In order to do what? Why? Commented May 17, 2018 at 6:34

1 Answer 1

1

To keep the netcat listening you could use the option -k, from the man:

-k      Forces nc to stay listening for another connection after its 
        current connection is completed.  It is an error to use this 
        option without the -l option.

You could use something like:

nc -lk 8080
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.