ping命令的高级用法

总结:ping命令的高级用法

 参照ping命令的帮助说明ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:

ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [-j computer-list]   [-k computer-list] [-w timeout] destination-list

  Options:

  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.

  不停的ping地方主机,直到按下Control-C。

  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。   

  -a Resolve addresses to hostnames.

  解析计算机NetBios名。

  示例:C:\ >ping -a 192.168.1.21

  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:

  Reply from 192.168.1.21: bytes=32 time <10ms TTL=254

  Reply from 192.168.1.21: bytes=32 time <10ms TTL=254

  Reply from 192.168.1.21: bytes=32 time <10ms TTL=254

  Reply from 192.168.1.21: bytes=32 time <10ms TTL=254

  Ping statistics for 192.168.1.21:

  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:

  Minimum = 0ms, Maximum = 0ms, Average = 0ms

  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。   

  -n count Number of echo requests to send.

  发送count指定的Echo数据包数。

  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:

  C:\ >ping -n 50 202.103.96.68

  Pinging 202.103.96.68 with 32 bytes of data:

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Request timed out.

  ………………

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Ping statistics for 202.103.96.68:

  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:

  Minimum = 40ms, Maximum = 51ms, Average = 46ms

  从以上就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值