Search notes:

Shell command: nc

nc (or netcat) is a a shell command for «just about everything under the sun invovling TCP, UDP or UNIX-domain sockets.
nc can be used, for example, to check if if a TCP port is open:
$ nc -vz server.xy 443

Test client server

nc can be used to rudimentarily test a client-server scenario.
In a shell, the «server» is started using -l to indicate the port where the server is listening. -q 1 tells the server to quit if it doesn't receieve any input from a client within 1 second after deliering the message (here: «hello from server):
$ echo 'hello from server' | nc -l 1234 -q 1
After the server is started, a client is started in another shell that connects to port 1234, then prints the message received from the server and then delivers another message («this is the client») to the server:
$ echo 'this is the client' | nc localhost 1234 -q 1
hello from server
Going back the the first shell, we see the server having printed the message from the client:
this is the client

Binary alternatives

After installing netcat in Debian with apt, I found the following alternatives:
$ sudo apt install -y netcat
…
$ readlink /bin/netcat
/etc/alternatives/netcat

$ readlink /bin/nc
/etc/alternatives/nc

$ readlink /etc/alternatives/netcat
/bin/nc.openbsd

$ readlink /etc/alternatives/nc
/bin/nc.openbsd

See also

Shell commands

Index