Linux根据端口号确定进程pid

命令为:

sudo netstat -lnp

截取某一行,如下所示:

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1137/mysqld

其中,3306就是本地server打开的端口号,1137是进程pid。

Leave a Reply

Your email address will not be published. Required fields are marked *