Last Updated: February 25, 2016
· codehill

Using nc (Netcat) as a Simple Chat Program in Linux

Using Netcat as a chat program is easy, to try it just run the command on one of the machines with the -l option to listen on a port (port 12345 in this example):

nc -l 12345

And on the other machine connect to the first using its IP address or hostname and the port it is listening on by entering:

nc 12345

Once the connection is made type anything on one of the machines and press enter to display it on the other. And to close the connection press CTRL + D on any of them.