|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 $ B$ t1 y. [; Z$ F! c$ `& A3 `
7 b# R s- B, \0 s4 O; N2 g 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ! n! ~ G& a% ?( B; {
7 G1 }9 `" ^6 ]" {/ O 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
* i6 n& R9 _' { 7 U Z3 ~! x1 P: }; L8 ]
Options: % A% h# R3 r: k! M! f) p Z
0 M6 b8 v% V" r. k
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( q$ z! E" H$ i) S+ O/ ^) j / z0 Y6 U2 i) n7 y: F
不停的ping地方主机,直到你按下Control-C。 - w5 z& W: n9 w8 @9 }' U5 K
7 z* i% G q0 D. i. w 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 & T" ~# X3 P ]( v6 [5 L; ~
7 B6 P- D1 H) \! s& l -a Resolve addresses to hostnames. & F. L0 D5 F3 ~: v5 g9 |4 K
+ ~! \9 f" X; v4 b
解析计算机NetBios名。 9 @. t1 X, ?8 ^; H! x+ Q# C
0 e: L1 w+ \9 p* X0 ? 示例:C:\>ping -a 192.168.1.21 0 [' T/ M' N/ U& y6 D9 C
8 f7 Z. w' Y, {8 _
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ T( K0 z% g* @ @: j ?3 f
' K+ A5 J0 ^5 N- |7 h Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; c t0 U8 T9 a: x/ B* o2 b
+ v# ^& |4 m" b$ y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 ?1 _7 F& R5 F4 l2 {! b
. m8 {" _, r$ N1 P3 l) U, Q5 e Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % Q& b! I- g p* }% D, F
$ Y& `, M+ D% l, @+ s- a h 5 D- g; o* c5 c2 k
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 Z9 w' @! X, g. e* I! f; T+ e* N
" W9 {& e. n) r- U; Z Ping statistics for 192.168.1.21: % v% ~- C3 r" I2 Z$ L9 u( Z! x; F
, t0 \) H/ k; L; I; e0 q Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 8 \9 E* w J$ R; S* L5 _; L
9 o8 h5 g/ p/ v9 q+ O: k Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 N! `* M& }! g U# m' I. z
4 ]" R: r* f; R# ?
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / ~7 Q' z; U% }' c c$ K( Q
5 ?" p" O+ V# s0 V4 ?/ ^ -n count Number of echo requests to send.
- R7 _& x: M; g8 B8 q! X; |
; Q. F: N/ ?% S1 I% T/ x1 X8 t 发送count指定的Echo数据包数。
' `+ I- E* P g0 T( t' A' u* V
( r; I( C" Z* [+ s+ h% X# B& e5 S# U 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 c# c$ V! _# D9 R8 t6 H
8 [& m9 @" b% C: z3 d
C:\>ping -n 50 202.103.96.68
( v. a7 v' ]. i# ]4 ]" T( X 4 q1 D/ N6 k2 B2 i g4 M6 c
Pinging 202.103.96.68 with 32 bytes of data: 4 \% q% }" u( p# P$ w/ p! L4 @$ \
# L$ i- m& F* n, o# b Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 K. F# s0 v9 g* }5 A7 { - ~& ]5 ?. r4 v# @9 L' B3 o; Q
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# b" b, n9 X2 F+ p3 j2 _* j 4 D' t6 y+ d5 A7 f9 j4 g
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + J7 ^- \7 w5 O3 Z: Q! ^) G* t6 V& N
/ v) |* V: y2 y a. i
Request timed out. ( P) `" c3 y; b0 h" Y0 y. k
. |4 P# D- X/ Z* p* t* @ ……………… ! A5 D0 b7 Y7 v' H
/ Q9 _- J8 E6 q' E! A
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " `0 `% g* `0 }) o' }3 ?# |
- f( }% o0 A& @- v9 [ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + B$ l4 d- ?! E' q+ L
% t( m4 ^5 g" @
Ping statistics for 202.103.96.68:
: H& B7 }$ o B9 v5 G. l 8 N! D4 K0 n4 U. A8 S+ P4 o
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 0 ^5 M) G7 \8 N; n6 c
; M$ d5 r' o6 K8 X1 _# m
Minimum = 40ms, Maximum = 51ms, Average = 46ms
. @( {/ K8 U) r2 x6 d
" X3 v9 t2 {* K. A# N- T 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 d" E. N# q+ w* f ) G& D5 o& K! d) A0 }1 ]# a
-l size Send buffer size.
6 ~' P; N# Q# b% U! q( n2 E/ U : v4 p3 m3 K" k$ J3 ~/ M/ V
定义echo数据包大小。 |
|