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

时间:2017-06-04 15:31:42   收藏:0   阅读:1810

1.查看当前连接IP地址:

[root@centos69 ~]# netstat -nat

Active Internet connections (servers and established)

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

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      

tcp        0      0 192.168.1.200:22   192.168.1.162:52265   ESTABLISHED 

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

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

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使用方法

原文:http://sadoc.blog.51cto.com/12189157/1932028

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!