2.1學習 ping ipconfig arp start shutdown taskkill 命令
學習要點:
1.測試IP連接:ping
2.查看IP配置:ipconfig
3.解析地址:arp
4.開啟命令:start
5.關閉或重啟計算機:shutdown
6.關閉指定進程taskkill
一.測試IP連接:ping
用來檢查網絡是否通暢或者網絡連接速度的命令。在此,我們只了解一些基本的參數就可以了。
-n count 發送count指定的Echo數據包數。
定義向目標IP發送數據包的次數,默認為4次。通過此命令可以收集到一些信息。如數據包返回的平均時間為多少,
最快時間為多少,最慢時間為多少等等。
例1
C:/Documents and Settings/mzybar>ping -n 3 www.baidu.com
Pinging www.jb51.net [121.14.88.14] with 32 bytes of data:
Reply from 121.14.88.14: bytes=32 time=3ms TTL=57
Reply from 121.14.88.14: bytes=32 time=3ms TTL=57
Reply from 121.14.88.14: bytes=32 time=2ms TTL=57
Ping statistics for 121.14.88.14:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 3ms, Average = 2ms
我們分析一下吧:
Ping statistics for 121.14.88.14:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
從這里可以知道在給www.baidu.com發送3個數據包的過程當中,返回了3個,沒有數據包丟失。
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 3ms, Average = 2ms
這3個數據包當中返回速度最快為2ms,最慢為3ms,平均速度為2ms。
例2
ping -n 11 127.0.0.1 >nul
ping本機11次,可用于批處理延時10秒。命令中的>nul為屏蔽輸出。
簡短式可以寫成:
ping -n 11 127.1 >nul
-w timeout 指定超時間隔,單位為毫秒。
例3
ping 1 -n 1 -w 10000 2>nul 1>nul
批處中可以用于延時10秒。
二.查看IP配置:ipconfig
由于批處理中經常對計算機的TCP/IP 配置信息的截取,這里我們只講一下/all參數就行了。
/all參數
作用:顯示所有適配器的完整 TCP/IP 配置信息。當使用IPConfig時不帶任何參數選項,那么它為每個已經配置了的
接口顯示IP地址、子網掩碼和缺省網關值。
例1
C:/Documents and Settings/mzybar>ipconfig
Windows IP Configuration
Ethernet adapter 本地連接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.73
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.254
這里顯示的信息為:
|
新聞熱點
疑難解答