1. lsof -i : <端口号>
2. nmap 127.0.0.1
3. sudo netstat -tunlp (不加sudo看不见PID)
4. gufw
参考
https://askubuntu.com/questions/9368/how-can-i-see-what-ports-are-open-on-my-machine
https://askubuntu.com/questions/9368/how-can-i-see-what-ports-are-open-on-my-machine