返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
9 |6 G1 `4 K0 C4 E( x8 A8 O! V8 s   1 q; M7 W) }/ {, t
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
1 g( L/ f; d$ g' M6 L, Q  
% v( j' `7 h' g7 E& ^5 Z  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 4 T! d0 q: ^, X
   1 l% d$ T$ c' y; R0 W: G1 `
  Options:
% S/ g' ~' I& G7 d- R& D  
' c  c: g, `+ \( z9 S8 `) ^0 w6 ?' l  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
+ U3 B1 S& L6 J1 w" p* p   * {7 A& c+ w, m$ _  [
  不停的ping地方主机,直到你按下Control-C。
  s& A/ z+ n1 o$ B0 a' w   ! L) O4 \8 v* e- w9 y  A2 l
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
& E9 [+ b; R' \' p  
9 s* I/ M, |$ A. C4 \  -a Resolve addresses to hostnames.
* g. o2 F7 z: e7 h  
/ B% i4 j/ h4 t- y2 W, E8 B( a  解析计算机NetBios名。 # h) o6 w! A. B! u' c  w. _- `
   / z! u' E4 ~( _( \
  示例:C:\>ping -a 192.168.1.21 7 s& q! ~# m/ m. f0 w. H
  
# {# u' {2 Q$ |. r  v8 ?  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 z$ P# \7 e* B7 d% h8 r   : l1 {2 b# c; H( h. r9 D" p! `4 l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; m- h! ]" Y$ ^# O/ F7 K  l2 B   / o+ h2 I/ _4 ?) s
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 j1 x6 U' R" ^0 R7 j     m7 `3 t2 I' d3 x$ m! u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% p7 A! j# U2 c) j' F; Z, m0 Y- C2 d  K
   ' D# {) o/ Q! g7 r1 F0 U
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) j0 ^# v, R' T1 ^! t# ?( s8 J  
  u/ m! {' [/ J4 Z& V  V  q  Ping statistics for 192.168.1.21: . S7 D, U; B# x; h( L
  
% c! c$ g9 K- i  @) ]7 ]  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: $ W  [0 h* p5 ^3 n  m( y; f, f7 y
  
# S- Z/ s% g3 k% c/ `) Z  Minimum = 0ms, Maximum = 0ms, Average = 0ms 6 O/ r* L' g, A+ V
  
: J  ~; z/ W/ o. _1 ?6 x+ ?  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
8 }' Y: s  A& }3 P' v: m  
' s& S. o/ ^' h6 p5 U/ f  -n count Number of echo requests to send.
) _6 m3 X5 J' s! n2 {! R$ `  
  u4 D; r; B2 {8 i  发送count指定的Echo数据包数。 . W, W7 b% b& N9 a# }
  
( O0 }" B6 S; Q$ L0 n  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: - H/ I: r* n, F+ f% D& S9 P
  
3 x! g. p) [+ f1 h- b# R, f; \  C:\>ping -n 50 202.103.96.68
) N4 d: _2 f# f) f4 V   0 a3 J) N" ]4 k$ J
  Pinging 202.103.96.68 with 32 bytes of data: % x. D$ j0 a  d
  
. J5 d: |  Z7 H3 g" H5 c" l1 s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! e  O& T9 r% _2 Y0 R
  
6 t, W4 X2 Z  `* @  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 g) b8 G, \# M8 I" f
   % C# F$ \3 \% N: \" E3 b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 _# x- d6 v8 }; J   , N# Q9 w9 D0 O
  Request timed out.
* v: f$ |$ {2 f, \+ u7 I$ s   ! E! W; d; k- J
  ………………
- Q9 |: Q5 U2 ^  
$ l0 _, i5 o% B, [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 A  s9 H8 p! C6 X1 C: L/ u- g
   6 s2 x  m, u. ^8 \" g9 R/ x
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & y9 ~/ F, i+ b; H! M$ W
   & H7 A/ ]7 u7 p5 x* m- y
  Ping statistics for 202.103.96.68: 5 p& c! M5 G) t  J& ?
   + c' U+ Z( y6 Z3 ^: E; _
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
" l& L, k& p( T  
& b1 k) b. G8 t8 h  Minimum = 40ms, Maximum = 51ms, Average = 46ms $ I3 E! `  ^- s4 R4 \/ n
  
& H4 t# X- T% |4 G* {7 t) L  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 O) G& a: @% v   ; M4 h" D/ c4 C: B, a, Y3 Y: J8 P# L# P
  -l size Send buffer size.
! d* t( ~) |# r: i  
( b0 m9 j& Y  \  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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