CentOS 查看开启的端口列表 | Linux

这该指令查看服务器已开启的端口

netstat -lntp
[root@host ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1314/master
tcp 0 0 :::1111 :::* LISTEN 1352/python
tcp 0 0 :::8888 :::* LISTEN 1352/python
tcp 0 0 ::1:25 :::* LISTEN 1314/master
tcp 0 0 :::443 :::* LISTEN 1327/httpd
tcp 0 0 :::4444 :::* LISTEN 1352/python
tcp 0 0 :::1021 :::* LISTEN 1057/sshd
tcp 0 0 :::7777 :::* LISTEN 1352/python
tcp 0 0 :::3333 :::* LISTEN 1352/python
tcp 0 0 :::6666 :::* LISTEN 1352/python
tcp 0 0 :::2222 :::* LISTEN 1352/python
tcp 0 0 :::9999 :::* LISTEN 1352/python
tcp 0 0 :::80 :::* LISTEN 1327/httpd
tcp 0 0 :::5555 :::* LISTEN 1352/python