Nmap is a great port scanner, but sometimes you want something more authoritative. You can ask the kernel what processes have which ports open by using the netstat
utility:
-t
TCP only-l
Listening ports only-n
Don’t look up service and host names, just display numbers-p
Show process information (requires root privilege)
netstat -tlnp