Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12378922
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: LINUX

2015-10-29 10:42:08

1.列出所有的端口
  netstat -a
  列出TCP协议的端口
  netstat -at
  UDP协议的端口
  netstat -au
2.列出处于监听状态的socket
  netstat -l
  列出监听的TCP端口
  netstat -lt
  列出监听的UDP端口
  netstat -lu
  列出监听的UNIX端口
  netstat -lx
3.列出协议的统计信息
  nestat -s
  比如: Ip:
    11150 total packets received
    1 with invalid addresses
    0 forwarded
    0 incoming packets discarded
    11149 incoming packets delivered
    11635 requests sent out
Icmp:
    0 ICMP messages received
    0 input ICMP message failed.
Tcp:
    582 active connections openings
    2 failed connection attempts
    25 connection resets received
Udp:
    1183 packets received
    4 packets to unknown port received.
   列出TCP协议的统计信息
   nestat -st
   列出UDP协议的统计信息
   netstat -su
4.显示进程ID和名称
  nestat -p
  其中-p选项可以和其它选项结合使用。
5.输出中不解析主机、端口、名称
  netstat -n
6. 持续打印netstat信息
  netstat -c
7.列出不支持的地址族
  netstat --verbose
8.列出内核的路由信息
  netstat -r
9. 列出在端口上运行的程序
  netstat -ap
  netstat -an | grep ':80'
10. 列出网络接口信息
  netstat –i


测试一例:

# netstat -a -t -n |grep -E '127|0.0.0.0'

image


转自网址:

http://blog.csdn.net/moxuansheng/article/details/6453028

阅读(3508) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~