1. 程式人生 > >linux 測試網路url命令

linux 測試網路url命令

1.curl 地址 或者 wget url地址

[[email protected] ~]$ curl www.baidu.com
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge><meta content=always name=referrer><link rel=stylesheet type=text/css href=http://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.css><title>鐧懼害涓€涓嬶紝浣犲氨鐭ラ亾</title></head> <body link=#0000cc> <div id=wrapper> <div id=head> <div class="head_wrapper"> <div class="s_form"> <div class="s_form_wrapper"> <div id=lg> <img hidefocus=true src=//www.baidu.com/img/bd_logo1.png width=270 height=129> </div> <form id=form name=f action=//www.baidu.com/s class="fm"> <input type=hidden name=bdorz_come value=1> <input type=hidden name=ie value=utf-8> <input type=hidden name=f value=8> <input type=hidden name=rsv_bp value=1> <input type=hidden name=rsv_idx value=1> <input type=hidden name=tn value=baidu><span class="bg s_ipt_wr"><input id=kw name=wd class="s_ipt" value maxlength=255 autocomplete=off autofocus></span><span class="bg s_btn_wr"><input type=submit id=su value=鐧懼害涓€涓class="bg s_btn"></span> </form> </div> </div> <div id=u1> <a href=http://news.baidu.com name=tj_trnews class="mnav">鏂伴椈</a> <a href=http://www.hao123.com name=tj_trhao123 class="mnav">hao123</a> <a href=http://map.baidu.com name=tj_trmap class="mnav">鍦板浘</a> <a href=http://v.baidu.com name=tj_trvideo class="mnav">瑙嗛</a> <a href=http://tieba.baidu.com name=tj_trtieba class="mnav">璐村惂</a> <noscript> <a href=http://www.baidu.com/bdorz/login.gif?login&amp;tpl=mn&amp;u=http%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 name=tj_login class="lb">鐧誨綍</a> </noscript> <script>document.write('<a href="http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u='+ encodeURIComponent(window.location.href+ (window.location.search === "" ? "?" : "&")+ "bdorz_come=1")+ '" name="tj_login" class="lb">鐧誨綍</a>');</script> <a href=//www.baidu.com/more/ name=tj_briicon class="bri" style="display: block;">鏇村浜у搧</a> </div> </div> </div> <div id=ftCon> <div id=ftConw> <p id=lh> <a href=http://home.baidu.com>鍏充簬鐧懼害</a> <a href=http://ir.baidu.com>About Baidu</a> </p> <p id=cp>&copy;2017&nbsp;Baidu&nbsp;<a href=http://www.baidu.com/duty/>浣跨敤鐧懼害鍓嶅繀璇/a>&nbsp; <a href=http://jianyi.baidu.com/ class="cp-feedback">鎰忚鍙嶉</a>&nbsp;浜琁CP璇30173鍙nbsp; <img src=//www.baidu.com/img/gs.gif> </p> </div> </div> </div> </body> </html>

 wget + 空格 + 要下載檔案的url路徑

[[email protected] ~]$ wget www.baidu.com
--2017-03-18 23:05:54-- http://www.baidu.com/
Resolving www.baidu.com... 220.181.112.244, 220.181.111.188
Connecting to www.baidu.com|220.181.112.244|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2381 (2.3K) [text/html]
Saving to: 鈥渋ndex.html.1鈥

100%[=============================================================================================================================>] 2,381 --.-K/s in 0s

2017-03-18 23:05:54 (317 MB/s) - 鈥渋ndex.html.1鈥saved [2381/2381]

2.ping ip地址  ctrl+c退出   ping只是測試網路聯接狀況以及資訊包傳送和接收狀況。

[[email protected]

~]$ ping www.baidu.com
PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.
64 bytes from 220.181.111.188: icmp_seq=1 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=2 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=3 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=4 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=5 ttl=53 time=28.8 ms
64 bytes from 220.181.111.188: icmp_seq=6 ttl=53 time=28.8 ms
64 bytes from 220.181.111.188: icmp_seq=7 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=8 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=9 ttl=53 time=28.8 ms
64 bytes from 220.181.111.188: icmp_seq=10 ttl=53 time=28.7 ms
64 bytes from 220.181.111.188: icmp_seq=11 ttl=53 time=28.8 ms
^C
--- www.a.shifen.com ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 10445ms
rtt min/avg/max/mdev = 28.748/28.801/28.892/0.148 ms

3.telnet ip地址 埠地址

[[email protected] ~]$ telnet www.baidu.com 80
Trying 220.181.112.244...
Connected to www.baidu.com.
Escape character is '^]'.
^C
Connection closed by foreign host.
[[email protected] ~]$ telnet www.baidu.com 443
Trying 220.181.112.244...
Connected to www.baidu.com.
Escape character is '^]'.
^C
^CConnection closed by foreign host.

4.可以使用traceroute命令顯示資料包到達目的主機所經過的路由。

[[email protected] ~]$ traceroute www.baidu.com
traceroute to www.baidu.com (220.181.111.188), 30 hops max, 60 byte packets
1 * * *
2 11.240.157.150 (11.240.157.150) 4.258 ms 11.240.144.214 (11.240.144.214) 1.127 ms 11.240.163.246 (11.240.163.246) 4.312 ms
3 140.205.27.210 (140.205.27.210) 2.072 ms 42.120.244.237 (42.120.244.237) 2.452 ms 106.11.144.33 (106.11.144.33) 1.178 ms
4 42.120.247.98 (42.120.247.98) 2.800 ms 42.120.247.110 (42.120.247.110) 1.142 ms 42.120.247.66 (42.120.247.66) 22.146 ms
5 * * 115.238.21.114 (115.238.21.114) 0.980 ms
6 220.191.200.77 (220.191.200.77) 1.837 ms 220.191.200.73 (220.191.200.73) 7.704 ms 220.191.200.125 (220.191.200.125) 1.119 ms
7 * * 202.97.68.165 (202.97.68.165) 23.180 ms
8 * * *
9 * * *
10 220.181.182.26 (220.181.182.26) 23.839 ms 220.181.17.94 (220.181.17.94) 23.776 ms 220.181.17.150 (220.181.17.150) 29.032 ms

5.可以使用ifconfig命令來配置並檢視網路介面的配置情況。

[[email protected] ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:01:02:33
inet addr:10.45.54.21 Bcast:10.45.55.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:343207526 errors:0 dropped:0 overruns:0 frame:0
TX packets:100026499 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57272669908 (53.3 GiB) TX bytes:142400917670 (132.6 GiB)

eth1 Link encap:Ethernet HWaddr 00:16:3E:01:13:EC
inet addr:114.55.11.127 Bcast:114.55.11.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1246009498 errors:0 dropped:0 overruns:0 frame:0
TX packets:945009458 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:304700165950 (283.7 GiB) TX bytes:339907719362 (316.5 GiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7975 (7.7 KiB) TX bytes:7975 (7.7 KiB)

6.顯示TCP/UDP傳輸協議的連線狀態

[[email protected] ~]$ netstat -u  netstat -t
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State

7.

[[email protected] ~]$ netstat -an | grep 7064
tcp 0 0 0.0.0.0:7064 0.0.0.0:* LISTEN
tcp 0 0 10.45.54.21:7064 100.97.54.29:6688 ESTABLISHED

相關推薦

linux 測試網路url命令

1.curl 地址 或者 wget url地址 [[email protected] ~]$ curl www.baidu.com<!DOCTYPE html><!--STATUS OK--><html> <head><meta http-equ

linux】---網路常用命令

修改主機名:  vi  /etc/sysconfig/network 修改DNS域名 vi  /etc/resolv.conf 修改域名對映關係: vi  /etc/hosts netstat檢視網路狀態 Nets

linux網路shell命令總結(一)

網路和監控命令類似於這些: hostname, ping, ifconfig, iwconfig, netstat, nslookup, traceroute, finger, telnet, ethtool 用於檢視 linux 伺服器 ip 地址,管理伺服器網路配置,通過 telnet

Linux測試環境部署相關命令和步驟

環境部署 執行命令 dep star 文件夾 stop nginx mod 找到 一、手動部署測試環境: 1、登錄172.XX.XX.XX 服務器(拉取最新代碼) 2、然後輸入 cd /XXX/XXX/XXXX 敲回車鍵,進入對應模塊 3、然後輸入 svn up 或

Linux高效能網路:協程系列09-協程效能測試

目錄 Linux高效能網路:協程系列01-前言 Linux高效能網路:協程系列02-協程的起源 Linux高效能網路:協程系列03-協程的案例 Linux高效能網路:協程系列04-協程實現之工作原理 Linux高效能網路:協程系列05-協程實現之原語操作 Linux高效能網路:協程

Linux 常用網路程序管理命令

1. 安裝netstat yum install net-tools 2. 檢視埠使用情況 netstat -anp|grep 8080 3. 結束程序 (1422為程序號) kill 1422 或者 強行結束程序  kill -9 1422 4. 同

Linux常用命令網路通訊命令

網路通訊命令 命令名稱:write 命令路徑:/usr/bin/write 執行許可權:所有使用者功能描述:向另外一個使用者發信息,以ctrl+D作為結束 語法:     write    <使用者名稱> Ex:&n

Linux系統之常用網路通訊命令與shell簡單應用技巧

(一)常用網路通訊命令 (1)ping命令 (2)write命令 (3)wall命令 (4)ifconfig命令 (5)shutdown命令 (6)reboot命令   (二)shell簡單應用技巧 (1)命令補齊 (2)命令歷史 (3)命令別名 (4)輸入/輸出重定向 (

linux 網路檢測命令詳解 ping nslookup tracert mtr

在Linux中有一個更好的網路連通性判斷工具,它可以結合ping nslookup traceroute  dig 來判斷網路的相關特性 mtr mtr能看到整個網路節點的資訊:mtr baidu.com   ,左側為網路節點的IP地址,右側為丟包

linux網路管理命令-httpstat

說明 httpstat 是一個 Python 指令碼,它以美妙妥善的方式反映了 curl 統計分析,它是一個單一指令碼,相容 Python 3 ,在使用者的系統上不需要安裝額外的軟體(依賴)。 從本質上

Linux網路操作命令

ifconfig 1.作用 ifconfig用於檢視和更改網路介面的引數和地址,包括IP地址、網路掩碼、廣播地址,使用許可權是超級使用者。 2.格式 ifconfig –interf ace [options] address 3.主要引數 -interface

Linux網路基礎命令ifconfig,ip,ss

ifcfg家族:         ifconfig:配置IP,NETMASK         route:路由         netstat:狀態及統

Linux常用網路命令

原文連結:https://linux.cn/article-7801-1.html ifconfig ping <IP地址>:傳送ICMP echo訊息到某個主機 traceroute <IP地址>:用於跟蹤IP包的路由 路由: nets

linux 常見網路命令集合

網絡卡資訊相關:ifconfig、ip,ethtool 路由相關:route、netstat、ip 檢視埠工具:netstat、lsof、ss、nc、telnet, nmap 下載工具:curl、wget、axel 防火牆:iptables、ipset 流量相關:i

Linux下使用ab命令進行高併發壓力測試

1、做壓力測試的工具:ab 2、效能的監控工具:nmon 檢視下linux主機上的ulimit -n 的資料,沒有改動過的是1024,最好要改的大一點。這個是linux下最大執行緒數,如果過小的話無法進行大並量的測試。    ab經行壓力測試時的指令碼我用的形式為:1.(g

Linux使用者管理、許可權管理、歸檔、壓縮以及建立連線和測試網路網路連通性

uid:使用者標識號 gid:組標識號 預設情況下,使用者uid和gid一樣 使用者的分類: 超級使用者(root):許可權特別大,uid=0,gid=0,生產環境建議不要使用 普通使用者:uid>=500,Ubuntu一般>=1000,一般許可權系統管理,

Linux系統網路裝置啟動和禁止“ifconfig eth0 up/down”命令的跟蹤

前面文章講了Linux系統的ethtool框架的一些東西,是從使用者空間可以直觀認識到的地方入手。同樣,本文從Linux系統絕大部分人都熟悉的“ifconfig eth0 up”命令來跟蹤一下此命令在核心中的發生了什麼事情。由於ifconfig啟動(up)和禁止(down)

LINUX開啟允許對外訪問的網路命令

LINUX通過下面的命令可以開啟允許對外訪問的網路埠:/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT #開啟8000埠之後儲存配置,重啟即可 LINUX通過下面的命令可以開啟允許對外訪問的網路埠: /sbin/i

linux 圖形介面網路配置命令

linux 圖形介面網路配置命令: https://www.aliyun.com/jiaocheng/167523.html?spm=5176.100033.1.13.7ae71fedpOlLu2 網路配置: 輸入 setup  回車,看到下面的介面,選擇Network  c

Linux顯示網路狀態的命令netstat

Linux netstat命令用於顯示網路狀態。 利用netstat指令可檢視整個Linux系統的網路情況,如網路連線,路由表,介面狀態 (Interface Statistics),masquerade 連線,多播成員 (Multicast Memberships) 等等。 語法