|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 . l& P; ?+ v! F m O1 n4 w3 B
2 h+ E( ]. c; ?/ n
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ t& y- x2 S/ S( z 5 ^% j. Q8 E! x. U0 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
8 ]& s4 x) _& f0 [4 f7 X 5 _6 j) \& p$ e3 ?+ z; ?/ W4 k
Options: & H. ~5 T, T( g+ x! b
$ r/ D1 T- ^& s# ~8 |2 y -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
3 P. |/ ]! I S& Q2 n
6 U" a! \. X5 R0 X& j& v/ b 不停的ping地方主机,直到你按下Control-C。 0 ?6 G4 K0 Z3 T; j# Q0 n
' ^. W8 ?4 }- C* m 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ; {& h# C+ p6 r
) m2 A& A9 Q. A; |2 G -a Resolve addresses to hostnames.
/ ]5 n' Z7 C+ J0 e% X% d# [
; ^. j4 j% J# [& c$ U/ ^, V4 w1 m 解析计算机NetBios名。 $ ^# z9 w4 o! t4 Q- {
# I$ @ }$ C1 m I! O
示例:C:\>ping -a 192.168.1.21
( t F+ n% W- u1 x2 m N3 L0 D& q" a & D8 W( j& g5 P" u
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! V) f/ S7 M5 Y # y: A# I* w3 i, T5 P
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + J2 Y4 ^( E* z7 H' N
0 @( {5 X# n* y4 ~" z5 H Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 D5 M9 B6 p" P) b
6 [8 v4 W# u& B5 x- V8 ~! R8 }) z9 J Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , a; p8 E$ }" n) U6 J5 Z% E& X8 M6 }
5 v" S# ]5 Y3 G* j) q1 m2 |( P
' [1 c# j S2 {- j Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 H. n" e4 `4 i# [1 X# o + }, b7 u& N' ~. d
Ping statistics for 192.168.1.21: & G3 i2 C) ], u& I& d- ?, m
+ K, r0 l# x/ d! a
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
/ R; v3 J5 e) Z0 ^" R 5 [( X* E* d% d! [$ x. f; o# m) f
Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 \, V' N, W U& I# K
/ H+ A+ K7 x* b& m' y& C+ Z 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 % |% p- n; M) n, d2 L* S$ W
/ O; ]/ p5 _, k4 P
-n count Number of echo requests to send.
1 i: _: p+ u; z ; z. g! p) x5 _ J% J
发送count指定的Echo数据包数。
& R2 m" z, k& O3 d, E E
& }3 \ F" c7 G. E6 z; a( l4 I% x 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 X j7 b6 J9 ?3 P7 r* M
+ U0 O0 L7 N+ y C:\>ping -n 50 202.103.96.68 2 U6 H+ S) q0 e! y a
* |) H' E2 n/ I G
Pinging 202.103.96.68 with 32 bytes of data: 3 W% X( c' P: a; [, l" o6 D
- S0 d8 c) c% ? Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- v6 ?- ~5 t- y/ W+ K$ ~( ]; | 3 j4 G7 @# r4 H( h) J
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! D! L: Q$ J( R1 Z( v; d H) C
4 N3 z. B8 p1 o: B6 P2 \ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' X% u* M* L! U" m) h
3 F4 ]8 e* x N9 |3 B$ U! X Request timed out.
' F5 I. _; I+ D* q4 V# e
( j+ T6 M, c; M' ^, |2 \/ Q ……………… ) n& ?& Z9 _* S5 q* \0 r3 \
3 Q& ~% r4 X+ q& z. ] Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : O; D1 j7 H& L" ^
4 |: P1 M* M# ?7 U
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 w0 \/ _2 {/ H* k3 E5 e! Q4 ^5 \ 3 a% T! R- W. Z/ m, o8 X* B' V
Ping statistics for 202.103.96.68: 0 `4 S1 u; k: Z% x7 R
7 [0 A' I) `- ], d& v Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
0 J9 `; O" y% f7 v ; d# ]& B) ~& P) d* W
Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 O7 l0 K6 ?' H$ `: ^
\ S% ]2 j+ u( G/ C
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
/ a9 C, | k- P) s 9 x' y$ N6 _( e0 W( ]1 W, Y
-l size Send buffer size. ' m* A0 H6 P+ ]! S$ p% B5 }8 t+ g$ q
" C' K2 O; {: b8 w* L 定义echo数据包大小。 |
|