3

I am looking for a simple command line tool to open TCP/UDP server/client on a desired port on a Linux machine. Are there any applications or commands that I can use to achieve this?

8

The nc (netcat) command will probably do what you need. It can listen on a specified port for TCP or UDP connections, and can also make outbound connections, depending on the command line arguments you specify.

If that's not what you're looking for, let me know.

| improve this answer | |
  • +1 very cool, I would have said to write a tiny Java program or something. I approve! – James T Snell Jul 6 '11 at 15:47
2
socat tcp-l:<port>

Similar to netcat, but with the advantages of being consistent (only one implementation versus the 6-8 different netcat versions) and having support for IPv6, UDP, SSL, SCTP, and so on.

| improve this answer | |
2

And, as a third option, there is the UCSPI-TCP package.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.