查看网络端口占用

来源:互联网 发布:煤炭进出口数据 编辑:程序博客网 时间:2024/05/16 07:32

Linux和Mac下通用:


1.  利用 netstat 查看网络状态命令:

netstat -an|grep 端口号


2. 利用list open file 命令打开文件(一切都是文件, 包括网络、 硬件等)

lsof -i :3306
此命令同时列出PID, 方便直接Kill进程

1 0