返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
9 e& X1 w3 n4 B7 x4 s) [   . _8 P' I) G! I1 X5 W1 W
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 B) U" _1 w5 P! T/ k" e
   2 G) N, m3 R; [2 N
  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 * U" h' v  w% ]4 p
   " Q% w- Z& D  k1 D7 ]
  Options: $ {8 n8 \: b, U% |& P: l
  
& j7 C" E; N4 A4 q/ h. ~  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
- B% y. _! F0 H$ n  D  |& H4 b( M   ' b* X2 `3 q5 D# ?9 {
  不停的ping地方主机,直到你按下Control-C。
( M8 P2 X8 @: W5 M& J" q% X   9 N) D+ G/ v3 W' ]; E
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( H$ x1 b- E+ g
  
5 A4 {0 F( N( Q$ U  -a Resolve addresses to hostnames. 2 N4 H0 P* O$ v, D3 C
   0 l$ {$ a4 U& Y# g# t6 _
  解析计算机NetBios名。 ' a8 [) T2 w: ]% I+ ?
  
; x. _! j* A1 D* C5 V4 a2 J  示例:C:\>ping -a 192.168.1.21
9 S" e" @2 a; r9 X; _% c" R# u  
3 k1 c4 w8 Z$ w4 J8 S  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 3 \/ M1 {. v, z: F; p1 p( B/ e
  
, X, K/ {. x2 X* U4 F  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 S- a  z4 T& y# H8 m
  
! M: D# n: {. C0 Z8 Z; s0 m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, K) G7 {: b8 i   7 h6 V1 M4 V; @6 d; m
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 {& w$ ~( l% {) w0 P2 s0 }) ~$ ?/ M# ]" {6 ~; E/ J6 y
  
; X! |- A& t( g6 F9 z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 m8 ~9 C# s. a: @9 t. R% M9 {
   & j5 `" O0 S: F
  Ping statistics for 192.168.1.21: 2 I: X+ C0 N% c! w
   ( p9 F: m0 m+ `& o; P7 x
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 ^. z+ W# Y8 L0 G& S1 |   , e/ E# d) h& M3 v1 l! K; V5 M
  Minimum = 0ms, Maximum = 0ms, Average = 0ms / F8 g! t2 t4 w6 d
  
$ C7 n1 t* ]$ }" E  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 + ?9 `6 i" n# v, x' ~- M; ]. `) S6 t
   ! R; i! h# v6 O' y. T' e1 u
  -n count Number of echo requests to send.
- i! D3 L, Y- E$ v+ t   ; g! ]; g4 C3 C) ~, `
  发送count指定的Echo数据包数。 - B, ]4 k" Q2 x1 w# G
  
  K3 J0 q6 v2 `7 V1 i  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   T7 u# a% D* @5 M* a+ ?
  
6 I6 G4 E6 n2 M/ q: P0 ^! l  C:\>ping -n 50 202.103.96.68 5 [1 Y5 F% f: t  r
  
! I7 g. {" l4 |3 S+ r  Pinging 202.103.96.68 with 32 bytes of data:
& H& r0 S. q! x- z7 P& ^  
/ @9 a8 a8 C4 W$ F) d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% r0 n# g! ^5 [1 s# V1 {  
$ E2 A; @7 M3 s6 N8 h, c! e2 Q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 G6 Y8 B' V" Y7 R   0 ^  S; Z# P- L( f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# v5 c2 u2 u$ t  
8 O, W5 U- E0 n  Request timed out.
" t7 J7 E( D% L2 N) M7 \1 \. m  
. |# }* J: O7 e" N, t6 R6 I* `  ………………
4 `0 A! |; {! R, V+ a, q   - A  k$ l3 M( A3 w4 h6 Q: Y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 N! A. B6 H6 p; W- k. }  
3 j7 v$ P6 q% n8 c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 `3 O+ `1 d% I% o# V/ a- @  {6 B  
' g( }9 P( h6 i! B4 @# {  Ping statistics for 202.103.96.68: 8 i: V/ f$ P2 ^: x: x4 D0 a+ g
   7 c- @! [+ _: i+ B; p  r! P/ [
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8 F# @" ?  B6 H( `" [1 _   % ?  H& D' o0 F/ ]( V5 r! ~* [8 p
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
) p- c3 q% m3 M, l+ A% H   - N+ B/ W" h( O& W% z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ; N0 q% N  y/ C2 j4 F, a
   ' i4 j. u' a  P; x# r6 }/ A
  -l size Send buffer size. 9 M4 F8 A3 |) c8 H
  
1 a4 w* J1 ]7 P5 m8 l; [% t$ h  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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