Under Linux, which command can show the ports currently being listened to by services?

link|improve this question

60% accept rate
feedback

1 Answer

up vote 3 down vote accepted

The -p option to netstat and ss will display the associated process of each socket.

sudo netstat -lptun

sudo ss -lp

You can also use lsof:

sudo lsof -iTCP -sTCP:LISTEN
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.