Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

4 Answers 4

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

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

ss -tlp

Quicker than netstat.

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

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

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.