List open network ports on FreeBSD

Method 1: Using the sockstat Command (Recommended)

List all listening IPv4 and IPv6 ports:

List only IPv4 listening ports:

List only IPv6 listening ports:

List only TCP listening ports:

List only UDP listening ports:

Method 2: Using the Traditional netstat Command

Show all listening network sockets:

Show all active connections and listening ports (numerical format):

-EOF-