linux如何查看端口号被哪个进程占用

1、lsof -i:端口号

lsof(list open files)

2、netstat -tunlp |grep 端口号

t:tcp

u:udp

n:拒绝显示别名

l:仅显示listen的服务状态

p:显示建立相关链接的程序名

原文地址:https://www.cnblogs.com/cherish010/p/8516079.html