不同操作系统查找端口对应的进程方法

AIX

 

1:首先根据端口号

netstat -Aan | grep 389

 

f1000089c27a2358 tcp4 0 0 *.389 *.* LIST EN

 

2rmsock f100089c27a2358 tcpcb

 

如果是tcp连接,则rmsock tcpcb

如果是udp连接,则rmsock inpcb

 

The socket 0x702f6800 is being held by proccess 4986 (inetd).

 

得到id4986

 

3ps ef |grep 4986

 

 

Windows

 

netstat -an –o

 

 

Solaris

 

查看22端口现在运行的情况

# lsof –i | grep 22

 

 

Linux

 

netstat -anp

 

请使用浏览器的分享功能分享到微信等