1.查看系统下所允许的所有端口情况 sudo netstat -antup 在sudo的权限下查看 不然会有部门进程看不到 2.用PID查询端口号 sudo netstat -antup | grep PID 3.用进程名查询PID sudo ps -ef |grep 进程名