User Matei Cezar presents us with a comprehensive list of 15 useful Sockstat commands, on finding open ports in FreeBSD. See the link below for the full set of instructions
Sockstat is a versatile command line utility used for displaying network and system opened sockets in FreeBSD. Mainly, sockstat command is installed by default in FreeBSD and it’s commonly used for displaying the name of the processes who opened a certain network port on a FreeBSD system.
However, sockstat can also list open sockets based on protocol version (both IP versions), on the state of the connection and on what ports a daemon or a program binds and listens on.
In this guide we’ll list some common utilization examples, but also very powerful, of sockstat command line networking utility in FreeBSD.