How to Check for Open Ports in Ubuntu

There are various ways to view for open ports on your local Ubuntu/Linux machine. However, I particularly prefer two methods/command below, since it is simple, and without any third-party application.

Open your command prompt, and type:
netstat -an | grep "LISTEN "

Or, another method:
sudo netstat --tcp --udp --listening --program

It will list all ports that your machine are listening to. The latter method will even shows the program name associated to it.

Enjoy.