List Open Ports on FreeBSD

On Linux to list running services and open ports, I either use netstat or ss (socket stat?) most recently. Though netstat is available on FreeBSD, the syntax is completely different. Today, I have the need to list the running services with the port display. On FreeBSD, we can do this using sockstat command. root@bsd1:~ # sockstat -4 -l USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS minio minio 49274 10 tcp46 *:9000 *:* root sendmail 675 4 tcp4 127....

April 8, 2020 · 1 min · 151 words · kenno