For installation of netstat on Ubuntu: install-basic-network-tools-on-ubuntu

Check all listening TCP connections

netstat -tlnp

Check all listening UDP connections

netstat -ulnp

-p means: PID number

-l means: listening

-t/-u: TCP or UDP

-i will show the network interface name

-n : will not try to resolve the name of the addresses.