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.

I want to use netstat -anp to check which program/process is listening a specific port. But the output includes lots of lines in which the value of 'PID/Program Name' column is just a -. For example

Active Internet connections (servers and established) 
Proto Recv-Q Send-Q   Local Address           Foreign Address         State    PID/Program name 
tcp        0      0   0.0.0.0:902             0.0.0.0:*               LISTEN      - 
tcp        0      0   0.0.0.0:5801            0.0.0.0:*               LISTEN      - 
tcp        0      0   0.0.0.0:5802            0.0.0.0:*               LISTEN    3641/Xvnc
tcp        0      0   0.0.0.0:139             0.0.0.0:*               LISTEN      - 
tcp        0      0   0.0.0.0:5901            0.0.0.0:*               LISTEN      - 
tcp        0      0   0.0.0.0:5902            0.0.0.0:*               LISTEN    3641/Xvnc

I can see 5802 and 5902 is listened by Xvnc, but what for 902, 5801, 139 and 5901? Thanks.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

It means that you do not have the appropriate privileges to determine the PID/program. Rerun netstat as the superuser, e.g. sudo netstat -anp.

share|improve this answer
    
Thanks a lot! :) –  Landy Jun 20 '11 at 10:07

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.