返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 p9 s* \/ ~% E. x, ?$ n
  
7 ]: F- Z* P3 a  H6 G  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:   d3 L" q- v2 l5 T' a
   , S) [% L5 J- ?" {9 C, }  }6 M- 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
( R7 w8 G2 M3 Y' H# i( y% B* S4 F9 }   ) x6 [2 P# r& s) J3 [
  Options: 0 ]5 N9 J' B- W1 m& {) p
   2 i3 ?9 ^/ _; g) b
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.   P9 f/ `/ q$ W' U/ k! X
  
- S, X. e# ?" F' R5 I  b  不停的ping地方主机,直到你按下Control-C。
6 p+ Q( y& M3 Z/ U- g  
- i  b" m  N) @5 }  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
% V4 [" D9 ?  {0 y0 o/ ~7 Y/ H+ D3 o" E  
$ {. r% k6 J. b  -a Resolve addresses to hostnames.
& j; S, x; t& d5 N& ^( y, ]   + J7 ^" q8 I3 h9 ]: }# Y( ~/ D. L
  解析计算机NetBios名。 2 T& r$ g2 [+ f0 X/ K/ Y9 Q( A+ j
  
! M6 C5 _1 q) F- G* ?* ]% z4 z2 d( {  示例:C:\>ping -a 192.168.1.21 " T2 v- s% x9 l, q. C
   6 Z6 _9 v* K2 ^7 ?+ S2 w
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
; C& L& ]! [3 |7 J$ V  
7 V0 R  J6 S7 H& I5 ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) r& R% N0 X' R7 Q1 e   ( Y+ F4 y9 h% Z0 n- U
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( k0 a7 ~  j. s9 e, W" J8 Y8 k  \" R
  
) |5 g& ^! ?6 @1 m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - D. z$ k2 V. X* q$ {
; t2 x5 n; c, S1 k7 _* y
  
; X. u) p1 G  r! n# P3 i9 \8 @# Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 B  }+ c# O6 _
  
+ v5 J$ x: o7 ~1 [# I  Ping statistics for 192.168.1.21: ! Y1 Y) A. I! Z- F7 S
   4 Y* u- }1 m  K% ~9 ^
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 m' F' d9 e' B
  
" q2 [& r- y/ W& a  Z  Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 C, h) h5 P/ ]" C& [) r' N0 a
   % N. w1 N  N6 u1 E7 w* V3 A2 D. D* l
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
: _, U+ y6 z0 g5 m$ s: ]   & j9 G4 U) |' W8 P
  -n count Number of echo requests to send. 3 j" ~9 X& a9 H* b0 k
  
" u; ~: P7 R6 K6 a- Z" T7 b% Q, w  发送count指定的Echo数据包数。 , n4 Q2 ~8 T9 v1 J- P" O$ G& B
   2 M2 p1 [9 K9 G$ }) D9 U5 H
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) m" w- M$ L8 x) Z% l7 y+ b3 `   6 E2 d! i( _4 }6 A
  C:\>ping -n 50 202.103.96.68 5 p3 ^  r0 t; @
  
" h  q8 t1 i6 A- }7 I  Pinging 202.103.96.68 with 32 bytes of data:
+ \- ~  K$ t! J6 p  
* J; Z3 C' o; E( P) |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  W- j1 ?& ^; W3 |     R+ u  d3 a, U$ B% `0 e$ W- _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 N* A& @+ `% [, @$ ^: w
   9 C- O/ A7 ?$ M% {( Q* M3 [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 y* c* I+ @! d8 a
   / L, }2 Q: A' f) h; [) g0 h6 ^
  Request timed out.
# J; @; f6 w+ s8 M! L! d8 a   2 @6 ?9 ~7 w# N+ K; \3 D
  ………………   l+ y4 L" C- ~  ^  G7 D! X
   8 n" G. t; A1 y/ w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " ^* |4 n8 ~) h+ r* D
   ; A# M1 ^' `9 ^9 S% e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " f% T" t. \. Y# @: @
  
% q1 D, P7 {% P9 {& U% a! s  Ping statistics for 202.103.96.68:
" G9 R! d  C5 c5 d5 F- L; |2 {  
# z6 b# U: \6 F+ n( A8 G( N  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: f1 c* o  }- H1 b% c  
: p4 f1 f; ~2 l# H8 y  Minimum = 40ms, Maximum = 51ms, Average = 46ms
6 J: |0 [6 Y) K* s. w& }. J0 H     W0 X3 ^7 z+ m$ e4 A# O* g+ {
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 o/ t0 s& S; Z! b  
3 a; ~: U" T9 i  `8 z/ w  -l size Send buffer size.   s. Y9 B+ r! s( M
  
% r0 h0 ^/ K: _$ ~  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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