Ubuntu terminal command -- view port occupancy and shutdown

Ubuntu to view port usage, use the netstat command:

View connected service ports (ESTABLISHED)

netstat -a

View all service ports (LISTEN, ESTABLISHED)

netstat -ap

To view the specified port, you can combine the grep command:

netstat -ap | grep 8080

 You can also use the lsof command:

lsof -i:8888

To close programs using this port, use kill + the corresponding pid

kill -9 PID号

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325229121&siteId=291194637