Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 3 down vote accepted
lsof -i :<port #>
share|improve this answer
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


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.