linux根據程序號查埠的2種方法
阿新 • • 發佈:2021-02-14
技術標籤:linux
[[email protected] conf]$ lsof -i|grep 57081
java 57081 db02 72u IPv4 364481 0t0 TCP *:7199 (LISTEN)
java 57081 db02 85u IPv4 364582 0t0 TCP 10.6.6.11:9042 (LISTEN)
java 57081 db02 159u IPv4 364576 0t0 TCP 10.6.6.11:afs3-fileserver (LISTEN)
[[email protected] conf]$ netstat -anp|grep 57081
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 10.6.6.11:9042 0.0.0.0:* LISTEN 57081/java
tcp 0 0 10.6.6.11:7000 0.0.0.0:* LISTEN 57081/java
tcp 0 0 0.0.0.0:7199 0.0.0.0:* LISTEN 57081/java
unix 2 [ ] STREAM CONNECTED 364573 57081/java
unix 2 [ ] STREAM CONNECTED 364479 57081/java
[ [email protected] conf]$