查看网络port占用

Linux和Mac下通用:


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

netstat -an|grep port号


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

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

原文地址:https://www.cnblogs.com/zhchoutai/p/6800718.html