linux根据端口号找出进程名

tech2025-06-16  2

1.使用lsof找出pid

lsof -i:22

2.使用netstat找出pid

#找出非监听端口 netstat -ntp | grep ":22" #找出监听端口 netstat -ntpl | grep ":22"

3.使用ps找出进程名

ps -ef|grep $pid
最新回复(0)