获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * L; G. Y3 x+ F% A; I; U/ L
  
$ n  N& S9 L; `& u: @, u  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
! B/ B" ^( r2 n4 e  
. [- F2 w9 A* ~4 `0 y4 b  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 ; k* F3 p2 Z' S& P: C0 G
   % N: r# M2 @- i" A: N2 i
  Options:
/ _8 h/ |& G% ?$ d# i: {. @/ Y  
, b6 Z; z, S0 S# J; K) M, K7 m  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 2 o( \# b! F1 ?( }* |6 I7 N, q+ B
   3 s* d; \% P4 m
  不停的ping地方主机,直到你按下Control-C。 - I' z6 q; e6 L3 u; \" `$ _
  
3 m' d3 f- y% X  i& D7 k- C4 }+ M& i4 `* F  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * _7 {$ x. W- }6 A, d
  
8 O( }* E+ q7 Q, Z' Z  Z% a1 G  -a Resolve addresses to hostnames. $ a7 V1 V+ k$ R  K& S" R. D/ m
  
' {; p6 L' g% `. R' z  解析计算机NetBios名。
+ j0 H4 q6 [) b0 G% d  
3 b6 ]/ ]# x: ]3 ~. w  示例:C:\>ping -a 192.168.1.21
$ S( x( n: w6 t6 X9 o   / \5 i& d  `1 C1 Y" }, [) ~/ h
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 3 B8 |" l& a. n; A/ A7 l
  
  l) X. X3 B9 ^3 j1 v1 O  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 g" X' T0 I6 u: v. x
   , u  O+ H" h4 I7 ]8 `
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 a0 J4 W, \4 Z( ^* `5 [   6 |' s; H. E& C$ e% @2 a; u, Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 V/ @" s/ g/ O8 e6 X
8 x; W* r; y" G
  
! h  U9 w$ R9 ^* k$ ~6 d1 s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & u  c) z0 ?; y: |  D1 W
   / \$ [3 w# p5 ]  ]' @5 I) t
  Ping statistics for 192.168.1.21: * T$ M. N. i2 S3 s8 d2 B
  
7 z8 J6 p: K; a+ E& Y' Y  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
$ s- S/ n- n/ O2 H4 v1 g0 o5 c' d  
+ _) X+ t9 @! I+ R9 l, z5 x  Minimum = 0ms, Maximum = 0ms, Average = 0ms ) O. @: ^, l& r
  
! g# z& n4 Q  P4 U! K8 `) j  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 9 H$ [$ H2 _) p6 R1 m7 j/ E# W
  
- Z% T- g% Z* ~8 Q  -n count Number of echo requests to send.
& f7 `5 X% O% [+ s   ; M$ _4 \7 b# {) ^$ N: b3 ]
  发送count指定的Echo数据包数。
& v1 h3 F* q2 ^' _% Y& O2 d   9 j& K! Y, X; o) K8 K
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 I" Z! m2 v: H  i. h2 K+ c7 {1 {
  
. V: a8 I$ K. J+ x& h  C:\>ping -n 50 202.103.96.68 9 C6 m% \) l7 u. c, w- Q( y+ M7 N' g
   ( b; j% u# P8 u% W: e
  Pinging 202.103.96.68 with 32 bytes of data:
# E- `6 S1 {3 C% ]9 v0 q8 q  
$ B% C+ Q1 E# H/ Q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 l5 `5 U/ E; D) ^7 _5 G  
( R' W. n, n: a- e0 w- Q/ H  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 s" `4 h  f! ?" V% ~
  
' c, Q2 t0 {% @. p; @8 e  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; S" S, x& V# m, j  w8 J
  
+ A+ |" J5 z# G5 j3 M, E  Request timed out. / J: u# j$ X& P  x2 E
   + V1 O. t. i4 a% D9 M+ z0 h; |
  ………………
  ~4 B$ j( {0 o, \- ^  
/ p+ t# z, t* j4 S. F" ]4 ^: D  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' R9 c2 m" f/ w# T2 d( z
  
5 Z) W  g  N: y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : F/ W# Z2 K/ Q. l" C5 M
  
4 P: g4 q" K6 d% K7 B! k  Ping statistics for 202.103.96.68: % S0 k( K/ n) E- Z5 B/ C/ ~
   ; V  \( l/ p- `6 G* m* A5 d. N8 x# N
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
( O" V5 j- A3 j  
4 D8 G: Z. O. z3 q8 u  Minimum = 40ms, Maximum = 51ms, Average = 46ms
9 u# r7 K" G4 b2 f4 s* {  
! ?. _7 n  E' W3 r  I8 d" l8 G  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
; d2 E5 ?, z9 U. \1 a, {, Z  
* L  ~8 s6 [3 P- N7 f6 {- y2 Q  -l size Send buffer size. # C: ^, Y; X- l8 }4 O
  
: z0 }  P0 w$ g7 n3 k9 [  定义echo数据包大小。
89w.org捌玖网络

强大,但是我看得不是很懂!

TOP

返回列表
【捌玖网络】已经运行: