5

the shell command netstat -p , doesn't display the pid. It displays "-" like this:

tcp        0      0 *:2181 *:53837 ESTABLISHED -

why?

It still display "-" although I use root to login.

phihag
  • 278,196
  • 72
  • 453
  • 469
Clam
  • 51
  • 1
  • 3

3 Answers3

4

Use sudo to see all fields.

$ sudo netstat -p 

Also, I like to use sudo netstat -pant because it is easy to remember, and I'm almost always only interested in seeing the TCP info.

kwarrick
  • 5,930
  • 2
  • 26
  • 22
1

Maybe this is a permissions problem, you can try sudo ?

xda1001
  • 2,449
  • 16
  • 18
1

Please go through the following documentation regarding netstat command:

http://www.cisco.com/en/US/products/hw/modules/ps2643/products_tech_note09186a00800fad79.shtml

try the command with sudo and see


sudo netstat -p

jyotiprakash
  • 2,086
  • 1
  • 20
  • 26