The first method:
root@debian:/home/# netstat-ant
Active Internet connections (servers and established)
Proto recv-q send-q Local address Foreign
TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:33223 0.0.0.0:* LISTEN
TCP 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
TCP6 0 0:: 1:25:::* LISTEN
TCP6 0 0:: 60042:::* LISTEN
TCP6 0 0:: £ º::* LISTEN
TCP6 0 0:: £ º::* LISTEN
TCP6 0 0 111.111.111.120:80 111.111.111.114:1119 established
TCP6 0 0 111.111.111.120:80 111.111.111.114:1123 established
TCP6 0 0 111.111.111.120:80 111.111.111.114:1125 time_wait
TCP6 0 0 111.111.111.120:80 111.111.111.114:1112 time_wait
TCP6 0 0 111.111.111.120:80 111.111.111.114:1110 time_wait
TCP6 0 0 111.111.111.120:80 111.111.111.114:1122 established
TCP6 0 0 111.111.111.120:80 111.111.111.114:1114 time_wait
TCP6 0 0 111.111.111.120:80 111.111.111.114:1117 time_wait
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/
The second method:
root@debian:/home# lsof-i:80
COMMAND PID USER FD TYPE DEVICE size/off NODE NAME
Apache2 2301 Root 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 2497 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 2498 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 2499 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 2500 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 2501 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 6108 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 6117 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
Apache2 6118 Www-data 4u IPv6 7298 0t0 TCP *:http (LISTEN)
MySQL default port
root@debian:/home# lsof-i:3306
COMMAND PID USER FD TYPE DEVICE size/off NODE NAME
Mysqld 2992 MySQL 10u IPv4 9546 0t0 TCP localhost:mysql (LISTEN)
Author: csdn Blog Yygydjkthh