Displays network-related information such as open connections, open socket ports, etc. More information: https://www.unix.com/man-page/osx/1/netstat.
netstat -a
netstat -l
netstat -t
netstat -p {{protocol}}
netstat -nr