  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
8 Q; q2 K6 j- V/ \; w x0 ^ : U+ f$ c- X8 G5 I) F: P6 o/ P6 o
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
[) W2 E4 D2 R1 {# D: h+ P 4 ]1 Z$ v% [& K! N6 U& U9 o. i) p
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 . S5 L3 [& c7 U6 E5 h' c, a
5 o# z3 Z) j! b6 n) E Options: & u, T( I6 }$ a
* P- a" M0 L5 G- V* N. ? -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. # D) Y, T0 x* e9 }- R& k9 `% {1 T
0 `/ s+ L6 U% h. x
不停的ping地方主机,直到你按下Control-C。
" ]1 v: A/ l# ^8 O
: m- x# |! X1 D" ]- G 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
8 T. c8 ] P. y% Q
+ o+ f& j3 _' A4 { -a Resolve addresses to hostnames.
2 Y# ?1 n( p4 S0 Q ! A+ g6 @. a1 j, U5 p7 t& R8 q
解析计算机NetBios名。
& ^5 Y/ n" q$ ~# c* R1 w
) F( w. _% I7 d 示例:C:\>ping -a 192.168.1.21 8 G g6 P& ]) m, F1 h! d; e; C
$ b- o7 o+ m- b$ `$ y7 ]& k Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 1 o, F% Y4 c5 ?+ ?1 v8 R. j( b
# P$ N- [0 X$ E3 a+ ] Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . Q6 C* E3 s- w, i
' b! u3 m" r/ G8 s Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , }7 P9 F, o% F
^) W! [9 L q: b; H! u
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 E) T, x4 r4 Y# R8 N
7 ?" }' A, \7 @0 j
3 e# @( U) S! _! _ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 V( O" T% ]; @& Y7 Z3 @
0 N, g: }7 ~! m! V
Ping statistics for 192.168.1.21:
5 X# J" l& f6 k. P" ~" g( E, @ 9 B: H5 k O5 n
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: # G( g) u4 i! f$ ^- Y
, ]+ I/ K7 w9 U0 M# Q0 j Minimum = 0ms, Maximum = 0ms, Average = 0ms - o! g G4 j) q4 ~
4 O C1 [& p1 O1 W0 O 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
! w) n( ?- t$ U. k& Y6 f
+ O# y! V$ Q" H! j& w; W0 E -n count Number of echo requests to send. 3 O) ^- P7 ~" k* D1 q
. `6 W6 Q. w) i7 H& t/ m- V
发送count指定的Echo数据包数。
# D2 n% K- X: j. ~$ _ `
7 y# b F; q, J& V6 B0 c 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; k# X* }' v2 P
# C- W" K* N, w; x
C:\>ping -n 50 202.103.96.68
' Y% k) ?: |7 R: D# x ( _" J# S, Z& \4 V
Pinging 202.103.96.68 with 32 bytes of data:
! d- q2 F6 _: p- g; ] ) Q8 ]7 _- O0 m) R
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* P" b$ b% g( u1 _2 w ' \* u6 d. w0 \. ~% ]
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( g2 y& Z( d, T0 {( h / [& F- P2 c$ J6 l
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + q% Q5 t$ F. F' D% f
/ ~1 i; T$ p% t' u7 e7 a5 u
Request timed out. ( ^+ _8 O9 V8 C5 z: M
2 ~+ p" }( n$ a ……………… 3 [6 e) W/ T" W. e( h- B
# u9 d4 h4 m% F+ ^" O
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 z* \% @2 v$ T. Z' E
0 V+ \/ Q: a" X7 E6 Y& u. ~ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 Q& Y# _& Z ^' f' ?
, \. W/ Q' I* k* Y M4 b Ping statistics for 202.103.96.68: 9 J7 A0 N! p3 M: o1 E" \7 o
/ z: J1 L. C' ? Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8 n6 u2 M* P, c% a
7 e* t. N2 ^. `- b4 w Minimum = 40ms, Maximum = 51ms, Average = 46ms
# Q9 K% O3 w6 e 3 s8 l+ }& b4 U$ M
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ x0 j4 j# X' L7 O( t! k7 s! ^( S
$ K, O# O- o$ ~$ Z -l size Send buffer size.
" w* z( X3 K' r- H9 Z/ ~ [
- b* O. n) \- a* Q 定义echo数据包大小。 |
|