您的位置:首页 > 运维架构 > Linux

linux 下通过pid 定位该程序打开的端口

2010-06-18 10:02 417 查看
首先使用ps aux 检测到耗资源的进程。

4652 mysql 15 0 454m 124m 4752 S 58 3.1 2144:29 mysqld

如mysqld。

之后使用网络命令:netstat -anp 来检测该程序链接的端口:

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:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:52422 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 4652/mysqld
tcp 0 0 0.0.0.0:3307 0.0.0.0:* LISTEN 5223/mysqld
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: