Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 9 down vote accepted

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.

share|improve this answer
    
+1 very cool, I would have said to write a tiny Java program or something. I approve! –  Doc Jul 6 '11 at 15:47
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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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