Finding the PID of the process using a specific port?
$ sudo ss -lptn 'sport = :4567'
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:4567 *:* users:(("jupyter-noteboo",2436,6))
LISTEN 0 128 :::4567 :::* users:(("jupyter-noteboo",2436,7))
或者
$ sudo netstat -nlp | grep :4567
tcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN 2436/python
tcp6 0 0 :::4567 :::* LISTEN 2436/python
或者
$ sudo lsof -n -i :4567 | grep LISTEN
jupyter-n 2436 ubuntu 6u IPv4 15227 0t0 TCP *:4567 (LISTEN)
jupyter-n 2436 ubuntu 7u IPv6 15228 0t0 TCP *:4567 (LISTEN)
这里,2436就是实际的进程号。