lsof -i:端口号
例如:
root@linux:~# lsof -i:1884
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
beam.smp 992 root 28u IPv4 26833 0t0 TCP *:1884 (LISTEN)
netstat -tunpl | grep 端口号
例如:
root@linux:~# netstat -tunpl | grep 1884
tcp 0 0 0.0.0.0:1884 0.0.0.0:* LISTEN 992/beam.smp
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:linux下查看某一端口被哪个进程占用(mac也同样适用)