Linux查看被監聽的端口

lsof -i:端口號 用於查看某一端口的佔用狀況,
好比查看9501端口使用狀況,lsof -i:9501php

zrj@zrj:~$ lsof -i:9501
COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
php     22123  zrj    3u  IPv4 13592045      0t0  TCP *:9501 (LISTEN)

netstat -tunlp |grep 端口號,用於查看指定的端口號的進程狀況
如查看9501端口的狀況,netstat -tunlp |grep 9501tcp

zrj@zrj:~$ sudo netstat -tunlp |grep 9501
tcp        0      0 0.0.0.0:9501            0.0.0.0:*               LISTEN      22123/php

Linux查看被監聽的端口

相關文章
相關標籤/搜索