|
Prev: How to list all active local ports where a server/services is listening?
Next: How to display "7" as left "0" padded 4 char wide field: "0007" ?
From: Stephane CHAZELAS on 16 Jun 2008 15:02 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 |