Super User is a question and answer site for computer enthusiasts and power users. 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

Is there a way to determine what program is listening to some port, TCP or UDP, in Linux?

share|improve this question
up vote 5 down vote accepted
netstat -lp

is the command you want, but you need to be root to see all the data.

share|improve this answer
    
Thanks. Didn't thought about reading netstat docs... – whitequark Jan 21 '10 at 15:46

ss -tlp

Quicker than netstat.

share|improve this answer
    
nice.. i didnt know about this command.. – Abhijeet Rastogi Jan 22 '10 at 13:12

Take a look at this and this page.

share|improve this answer
    
lsof trick is cool, thanks – whitequark Jan 21 '10 at 15:48
    
You're welcome. – Mehper C. Palavuzlar Jan 21 '10 at 15:49

Already answered, but if it's on a system you don't have a shell on, running nmap -sV -p <port number> <target> will often give you the answer. Add -sU if scanning a UDP port.

share|improve this answer
    
I know about nmap... anyway, I didn't wrote it in question, so +1. – whitequark Jan 24 '10 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .