- Stream sockets - TCP
- Datagram sockets - UDP
- Unix Domain sockets (UDS) - local, can be stream or datagram
Use the ss
tool. Options:
ss -4 -tln
Options:
- 4 - IPv4 only
- t - tcp only
- l - listening only
- n - display port number
Use the nc
tool:
nc -4 -vz 127.0.0.1 8080
Options:
- 4 - IPv4
- v - verbose
- z - connect only, don't send data