From: Stephane CHAZELAS on
2008-06-16, 18:53(+00), Wolfgang Meister:
> How can I list all local ports where a local server or services is listening?
>
> The listing should contain the path and program name of the listening server/service.
>
> So I need something like:
>
> port=22 /lib/svc/method/sshd
> port=25 /bin/emailprgm
> ...
> port=1049 /ust/local/bin/myserver
>
> How can I do this?
[...]

Since you seem to be on Linux:

sudo ss -lnp

sudo netstat -anp | grep -w LISTEN

sudo lsof -i -P | grep LISTEN

That latter one works on other Unices.

--
St�phane