Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How to find out what processes are listening on specific ports in Ubuntu?

share|improve this question

5 Answers 5

up vote 3 down vote accepted
lsof -i :<port #>
share|improve this answer
1  
This will show only processes owned by user. So, unless you're logged in as root, prepend sudo. –  xyz Aug 3 '09 at 12:57

Assuming that you are root.

netstat -lnp

The 4th and 7th fields are what you want.

Alternatively you can get much more detailed information with lsof(1).

share|improve this answer

best way i know of is:

netstat -lpn

run as super user

share|improve this answer

This works pretty well for me on linux only:
netstat -anp|egrep -i 'PID/Program|LISTEN'

-a = All sockets -n = doNt resolve IPs -p = show Pids/Programs associated with each

share|improve this answer

su -c netstat -lpna

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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