Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the command "netstat -p" doesn't display the pid

Tags:

shell

netstat

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.

like image 596
Clam Avatar asked Feb 27 '12 08:02

Clam


1 Answers

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.

like image 144
kwarrick Avatar answered Sep 24 '22 13:09

kwarrick