日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Wget使用

發(fā)布時間:2025/6/17 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Wget使用 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

http://www.tuicool.com/articles/A7BRny

wget / curl 是兩個比較方便的測試http功能的命令行工具,大多數(shù)情況下,測試http功能主要是查看請求響應(yīng) 頭信息 ,而給這兩個工具加上適當?shù)拿钚袇?shù)即可輕易做到,其實查man手冊就能找到對應(yīng)的參數(shù)選項,不過這里仍然mark一下。

wget的debug選項:
–debug
Turn on debug output, meaning various information important to the developers of
Wget if it does not work properly. Your system administrator may have chosen to
compile Wget without debug support, in which case -d will not work. Please note
that compiling with debug support is always safe—Wget compiled with the debug
support will not print any debug info unless requested with -d.

實例(可以看到,wget鏈接請求默認采用的是HTTP/1.0協(xié)議):

[root@localhost ~]# wget 127.0.0.1 --debug DEBUG output created by Wget 1.12 on linux-gnu.--2012-05-26 12:32:08-- http://127.0.0.1/ Connecting to 127.0.0.1:80... connected. Created socket 3. Releasing 0x09cdfb18 (new refcount 0). Deleting unused 0x09cdfb18. ---request begin--- GET / HTTP/1.0 User-Agent: Wget/1.12 (linux-gnu) Accept: */* Host: 127.0.0.1 Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 200 OK Server: nginx/1.2.0 Date: Sat, 26 May 2012 04:32:08 GMT Content-Type: text/html Content-Length: 186 Last-Modified: Fri, 25 May 2012 02:41:59 GMT Connection: keep-alive Accept-Ranges: bytes ---response end--- 200 OK Registered socket 3 for persistent reuse. Length: 186 1 Saving to: “index.html.42” 100%[================================================================>] 186 --.-K/s in 0s 2012-05-26 12:32:08 (4.72 MB/s) - “index.html.42” saved [186/186] [root@localhost ~]#

如果wget不帶–debug選項,則可以使用-S、–save-headers選項,不過此時只能查看響應(yīng)頭部信息:
-S
–server-response
Print the headers sent by HTTP servers and responses sent by FTP servers.

–save-headers
Save the headers sent by the HTTP server to the file, preceding the actual contents,
with an empty line as the separator.

實例:

[root@localhost ~]# wget -S 127.0.0.1 --2012-05-26 12:38:32-- http://127.0.0.1/ Connecting to 127.0.0.1:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Server: nginx/1.2.0 Date: Sat, 26 May 2012 04:38:32 GMT Content-Type: text/html Content-Length: 186 Last-Modified: Fri, 25 May 2012 02:41:59 GMT Connection: keep-alive Accept-Ranges: bytes Length: 186 1 Saving to: “index.html.44” 100%[================================================================>] 186 --.-K/s in 0s 2012-05-26 12:38:32 (4.52 MB/s) - “index.html.44” saved [186/186] [root@localhost ~]#

利用curl的-v查看請求響應(yīng)頭部信息:
-v/–verbose
Makes the fetching more verbose/talkative. Mostly useful for debugging. A line
starting with ’>’ means “header data” sent by curl, ’ < ’ means "header data"
received by curl that is hidden in normal cases, and a line starting with ’*’
means additional info provided by curl.

Note that if you only want HTTP headers in the output, -i/--include might be the
option you’re looking for.

If you think this option still doesn’t give you enough details, consider using
--trace or --trace-ascii instead.

This option overrides previous uses of --trace-ascii or --trace.

Use -s/--silent to make curl quiet.

實例(可以看到,wget鏈接請求默認采用的是HTTP/1.1協(xié)議):

[root@localhost aa]# curl -v 127.0.0.1 * About to connect() to 127.0.0.1 port 80 (#0) * Trying 127.0.0.1… connected * Connected to 127.0.0.1 (127.0.0.1) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (i686-pc-linux-gnu) libcurl/7.19.7 NSS/3.12.7.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: 127.0.0.1 > Accept: */* > < HTTP/1.1 200 OK < Server: nginx/1.2.0 < Date: Sat, 26 May 2012 04:45:12 GMT < Content-Type: text/html < Content-Length: 186 < Last-Modified: Fri, 25 May 2012 02:41:59 GMT < Connection: keep-alive < Accept-Ranges: bytes < <html> <head> <title>Welcome to nginx!</title> </head> <body bgcolor="white" text="black"> <center><h1>Welcome to nginx!</h1></center> <center><h1>root:web</h1></center> </body> </html> * Connection #0 to host 127.0.0.1 left intact * Closing connection #0 [root@localhost aa]#

利用curl的-I選項僅查看響應(yīng)頭部信息:
-I/--head
(HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD
which this uses to get nothing but the header of a document. When used on a FTP
or FILE file, curl displays the file size and last modification time only.

實例:

[root@localhost aa]# curl -I 127.0.0.1 HTTP/1.1 200 OK Server: nginx/1.2.0 Date: Sat, 26 May 2012 04:43:12 GMT Content-Type: text/html Content-Length: 186 Last-Modified: Fri, 25 May 2012 02:41:59 GMT Connection: keep-alive Accept-Ranges: bytes [root@localhost aa]#

轉(zhuǎn)載于:https://www.cnblogs.com/diyunpeng/p/6707048.html

總結(jié)

以上是生活随笔為你收集整理的Wget使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 五十路在线 | av大片免费看 | 久久在线一区二区 | 日本三级一区二区 | 亚洲天堂第一 | 欧美日韩不卡一区二区三区 | 麻豆av电影在线观看 | 午夜成人免费影院 | 中文字幕一区二区三区电影 | 久久精品免费看 | 91传媒视频在线观看 | 亚洲第一成年网 | 亚欧日韩av| 精品国产乱码久久久久久免费 | 一级在线毛片 | 成人黄色电影网址 | 亚洲av毛片基地 | 国产精品免费网站 | 国产淫片av片久久久久久 | 亚洲二区视频 | 亚洲免费片 | 久久久久综合 | 美女脱裤子打屁股 | 日韩专区中文字幕 | 国产精品久久一区二区三区 | 成人av18| 国产精品无码久久久久高潮 | 成人h动漫精品一区二区器材 | 国产香蕉视频在线 | 97人人模人人爽人人少妇 | 樱桃国产成人精品视频 | 女人性做爰69片免费看 | 国产无套粉嫩白浆内谢 | 30一40一50女人毛片 | 国产情侣激情自拍 | 在线观看中文字幕一区 | 欧美一区二区三区久久 | 性视频在线 | 一级欧美一级日韩片 | 国产乱码一区二区三区播放 | 亚洲精品视频在线看 | 波多野结衣操 | 欧美性猛交xxxx乱大交俱乐部 | たちの熟人妻av一区二区 | 亚洲天堂网视频 | 国产视频1 | 蜜美杏av | 国产精品久久久久久白浆 | 亚洲av无码一区二区乱孑伦as | 亚洲成人精品在线播放 | 精品国产一级片 | 另类专区欧美 | 亚洲精品中字 | 久久小草| 一区二区精| 色综合婷婷 | 嫩草一区二区三区 | 国产一区二区三区在线 | 国产高清久久 | 亚洲欧美日韩专区 | 欧美日韩亚洲视频 | 一区二区三区在线免费 | 久久久久久草 | 日韩精品区 | 国产男女猛烈无遮挡免费视频 | 国产第一色 | 成人亚洲在线 | 人人插人人草 | 国产成人无码精品久久久久久 | 久久香蕉综合 | 国产精品久久久久野外 | 曰本女人与公拘交酡 | 日韩乱码人妻无码中文字幕 | 国产a级一级片 | 在线观看免费福利 | 欧美一区二区三区黄片 | 日本www在线观看 | av不卡网| 蜜臀av免费一区二区三区水牛 | www成人网 | 成人ay| 中文字幕一区二区av | 国产青草 | 亚洲社区在线观看 | 亚洲男人天堂av | 999毛片| 精品人妻一区二区三区日产乱码卜 | 97人人草| 特级黄色录像 | 毛片黄色片 | 成人在线观看h | 成人a√| 色版视频 | 中国黄色免费 | 亲嘴脱内衣内裤 | 青青草网址 | 日韩激情在线观看 | 亚洲成人av影片 | 男人插入女人下面视频 |