Command to find open port and associated service

Command:

netstat -ntpl

-t or –tcp
-n or –numeric
Show numerical addresses instead of trying to determine symbolic host, port or user names.
-p or –program
Show the PID and name of the program to which each socket belongs.
-l or –listening
Show only listening sockets.