Naftuli Tzvi Kay Naftuli Tzvi Kay - 2 years ago 207
Linux Question

Simple Socket Server in Bash?

Is there a way to quickly bind to a TCP port/ip address and simply print out all information to STDOUT? I have a simple debugging solution which writes things to and I'd like to be able to simply bind up a port from bash and print everything that comes across. Is there an easy way to do this?

Answer Source
$ nc -k -l 4444 > filename.out

see nc(1)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download