Run Your Own Mail Server has finally forced me to write a bit about netcat versus telnet.
Netcat is a flexible network tool that, among other things, allows you to connect to arbitrary TCP/IP ports. We’ll use it for testing services. Over the decades netcat has been forked, reimplemented, and served as inspiration for other programs that also call themselves netcat. These variants made no effort to make their added features compatible with other variants. Your Unix might provide a netcat-alike such as ncat or socat. Long commands are not very Unixy so netcat, ncat, and others often get installed as nc. If you have a problem using netcat focus your investigation on your exact version, and not netcat in general.
With all these issues, why use netcat and not telnet? If you think netcat has been forked, wait until you get a look at telnet. Telnet mingles standard output with standard error, and silently modifies text for compatibility with interactive shells.
If this book interests you, or if you want to encourage me to wreck my life by writing it, please consider sponsoring it.