Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What is the simplest way to do the following thing?

Run a program which will open specified port, listen for it, and display whatever it receives. Also if type something -- then send back to connected peer.

This is for debug purposes.

share|improve this question
    
You can use thegeekstuff.com/2012/04/nc-command-examples for the same –  Rahul Patil Jan 2 '13 at 10:08

2 Answers 2

up vote 3 down vote accepted

Server listens on port 8000:

$ nc -l 8000

Client connects to port 8000:

$ nc localhost 8000 
share|improve this answer

This sounds like a job for Gnu Netcat (nc)

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.