https://github.com/NanXiao/openbsd-netcat-demystified
Owing to its versatile functionalities, netcat earns the reputation as "TCP/IP Swiss army knife". For example, you can create a simple chat app using netcat:
(1) Open a terminal and input following command:
# nc -l 3003
This means a netcat process will listen on 3003 port in this machine (the IP address of current machine is 192.168.35.176).
(2) Connect aforemontioned netcat process in another machine, and send a greeting:
# nc 192.168.35.176 3003
hello
Then in the first machine's terminal, you will see the "hello" text:
# nc -l 3003
hello