netstat查看系统链接数及当前链接IP

1.查看当前链接IP地址:centos

[root@centos69 ~]# netstat -nattcp

Active Internet connections (servers and established)ide

Proto Recv-Q Send-Q Local Address    Foreign Address       State      spa

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      .net

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      server

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      it

tcp        0      0 192.168.1.200:22   192.168.1.162:52265   ESTABLISHED io

tcp        0      0 :::22                       :::*                        LISTEN      class

tcp        0      0 ::1:25                      :::*                        LISTEN      awk

2.查看80端口链接数

netstat -nat|grep -i '80'|wc -l

3.查看当前链接状态数量如LISTEN /ESTABLISHED /tcp

netstat -na|grep LISTEN|wc -l

4.查看链接IP

netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'

5.netstat --help使用方法

相关文章
相关标签/搜索