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号