How to view the details of the process of listening on a port

command:

sudo lsof -i -P -n | grep LISTEN

 

 Then the ps command to find the process to port 6060:

 ps -aux |grep  "69842"

 

Guess you like

Origin www.cnblogs.com/smallleiit/p/12666655.html