{"id":264009,"date":"2023-02-10T22:00:39","date_gmt":"2023-02-10T14:00:39","guid":{"rendered":"https:\/\/lrxjmw.cn\/lsbbksdzjgjw.html"},"modified":"2023-02-10T22:00:39","modified_gmt":"2023-02-10T14:00:39","slug":"lsbbksdzjgjw","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lsbbksdzjgjw.html","title":{"rendered":"Linux\u4e0a\u5fc5\u4e0d\u53ef\u5c11\u7684\u88c5\u673a\u5de5\u5177–wget"},"content":{"rendered":"

1.wget\u7b80\u4ecb<\/p>\n

wget\u662fLinux<\/a>\u5e73\u53f0\u4e0a\u6700\u5e38\u7528\u7684\u547d\u4ee4<\/a>\u884c\u4e0b\u8f7d\u5de5\u5177\u4e4b\u4e00\u3002\u652f\u6301http\/https\/ftp\u5408\u540credhat linux\uff0c\u652f\u6301http\u4ee3\u7406\u3001\u540e\u53f0\u4e0b\u8f7d\u3001\u7f51\u7ad9\u955c\u50cf\u4e0b\u8f7d(\u9012\u5f52\u4e0b\u8f7d)\u3001\u9650\u901f\u4e0b\u8f7d\u3001\u65ad\u70b9\u7eed\u4f20\u3001\u6307\u5b9auser-agent(\u6a21\u62df\u4e0d\u540c\u6d4f\u89c8\u5668)\u3001\u9650\u5236\u4e0b\u8f7d\u5927\u5c0f\u7b49\u7b49\u5b9e\u7528\u529f\u80fd\uff0c\u662fLinux\u4e0a\u5fc5\u4e0d\u53ef\u5c11\u7684\u88c5\u673a\u5de5\u5177\u3002\u7c7b\u4f3c\u529f\u80fd\u7684\u5de5\u5177\u662f\uff1acurl<\/p>\n

2\uff1a\u5b89\u88c5wget<\/p>\n

\u4ee5CentOS7.6\u4e3a\u4f8blinux\u600e\u4e48\u8bfb\uff0c\u6700\u5c0f\u5316\u5b89\u88c5\u5e76\u6ca1\u6709\u5305\u62ecwget\uff0c\u987b\u8981\u81ea\u52a8\u5b89\u88c5\u3002<\/p>\n

\u547d\u4ee4\uff1a<\/p>\n

\n

[root@zcwyou ~]# yum -y install wget\n<\/code><\/pre>\n<\/p>\n

\u542c\u5230\u6700\u540e\u7684\u8f93\u51faComplete!\u8bc1\u660e\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n

Installed:<\/p>\n

wget.x86_640:1.14-15.el7_4.1Complete!<\/p>\n

\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n

\n

[root@zcwyou ~]# rpm -qa |grep wget\n<\/code><\/pre>\n<\/p>\n

\u53ef\u4ee5\u89c1\u5230\u6709\u7ed3\u679c\u8f93\u51fa\uff1a<\/p>\n

wget-1.14-15.el7_4.1.x86_64<\/p>\n

3.wget\u5b9e\u7528\u4e8b\u4f8b3.1.\u4e0b\u8f7d\u4e00\u4e2a\u6587\u4ef6<\/p>\n

\u9009\u9879\uff1awget\u52a0\u7f51\u5740\u5373\u53ef<\/p>\n

\n

[root@zcwyou ~]# wget https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.2\u6307\u5b9a\u4fdd\u5b58\u7684\u6587\u4ef6\u540d<\/p>\n

\u9009\u9879-O<\/p>\n

\u6307\u5b9a\u4e0b\u8f7d\u56de\u53bb\u7684\u6587\u4ef6\u53e6\u5b58\u4e3awordpress.tar.gz<\/p>\n

\n

[root@zcwyou ~]# wget -O wordpress.tar.gz https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\u7684\u7f18\u7531\u662f\uff1a\u52a8\u6001\u7684\u7f51\u9875\u94fe\u63a5\uff0c\u5e76\u4e0d\u76f4\u63a5\u5e26\u5e38\u89c1\u7684\u6587\u4ef6\u540d\u3002wget\u9ed8\u8ba4\u4f1a\u4ee5\u6700\u540e\u4e00\u4e2a\u7b26\u5408\u201d\/\u201d\u7684\u524d\u9762\u7684\u5b57\u7b26\u6765\u547d\u4ee4\uff0c\u6240\u4ee5\u4e0b\u8f7d\u56de\u53bb\u7684\u6587\u4ef6\u540d\u901a\u5e38\u90fd\u662f\u6709\u95ee\u9898\u7684\u3002<\/p>\n

3.3\u9650\u5236\u4e0b\u8f7d\u901f\u7387<\/p>\n

\u4f7f\u7528\u9009\u9879\u2013limit-rate<\/p>\n

\n

[root@zcwyou ~]# wget --limit-rate=123k https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.4\u65ad\u70b9\u7eed\u4f20<\/p>\n

\u4f7f\u7528\u9009\u9879-c<\/p>\n

\n

[root@zcwyou ~]# wget -c https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.5\u540e\u53f0\u4e0b\u8f7d<\/p>\n

\u4f7f\u7528\u9009\u9879-b<\/p>\n

\n

[root@zcwyou ~]# wget -b https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.6\u4fdd\u5b58\u4e0b\u8f7d\u65e5\u5fd7<\/p>\n

\u9009\u9879-o<\/p>\n

\u4e8b\u4f8b\uff1a\u628a\u4e0b\u8f7d\u7684\u65e5\u5fd7\u4fdd\u5b58\u5230wget123.log\uff0c\u4e00\u822c\u7ed3\u5408\u540e\u53f0\u4e0b\u8f7d\u9009\u9879-b\u4e00\u8d77\u4f7f\u7528<\/p>\n

\n

[root@zcwyou ~]# wget -b -o wget123.log https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.7\u6307\u5b9a\u7528\u6237\u4ee3\u7406\uff0c\u5373\u6a21\u62df\u4e2a\u522b\u6d4f\u89c8\u5668<\/p>\n

\u4f7f\u7528\u9009\u9879--user-agent<\/p>\n

\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\u7684\u7f18\u7531\u662f\uff0c\u4e2a\u522b\u7f51\u7ad9\u9650\u5236\u6d4f\u89c8\u5668\u7684\u7248\u672clinux\u4e2d\u5982\u4f55\u4e0b\u8f7d\u6587\u4ef6<\/strong>\uff0c\u4e2a\u522b\u6d4f\u89c8\u5668\u4e0d\u80fd\u8bbf\u95ee\u3002<\/p>\n

\u6a21\u62dfWindows10\u7684Edge\u6d4f\u89c8\u5668<\/p>\n

linux\u4e2d\u89e3\u538b.7z\u6587\u4ef6_linux\u4e2d\u5982\u4f55\u4e0b\u8f7d\u6587\u4ef6_linux\u4e2dtftp\u4e0a\u4f20\u4e0b\u8f7d\u6587\u4ef6<\/p>\n

\n

[root@zcwyou ~]# wget --user-agent=\"Mozilla\/5.0 (Windows; U; Windows NT 10.0; en-US) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/64.0.3282.140 Safari\/537.36 Edge\/17.17134\" https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

\u6a21\u62dfWindows10\u7684IE11\u6d4f\u89c8\u5668<\/p>\n

\n

[root@zcwyou ~]# wget --user-agent=\"Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 10.0; en-US)\" https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.8\u6d4b\u8bd5\u94fe\u63a5<\/p>\n

\u4f7f\u7528\u9009\u9879--spider\uff0c\u5e76\u4e0d\u4f1a\u771f\u6b63\u4e0b\u8f7d\u6587\u4ef6<\/p>\n

\n

[root@zcwyou ~]# wget --spider https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

\u89c1\u5230\u8f93\u51fa\uff1aRemotefileexists.\u5373\u53ef\u8bc1\u660e\u8be5\u4e0b\u8f7d\u94fe\u63a5\u6709\u6548\u3002<\/p>\n

3.9\u8c03\u6574\u91cd\u8bd5\u6b21\u6570<\/p>\n

\u4f7f\u7528\u9009\u9879--tries<\/p>\n

\u5f53\u7f51\u8def\u8d28\u91cf\u5341\u5206\u5dee\u7684\u60c5\u51b5\u4e0b\u4f7f\u7528linux\u4e2d\u5982\u4f55\u4e0b\u8f7d\u6587\u4ef6<\/strong>\uff0c\u63d0\u9ad8wget\u7684\u4e0b\u8f7d\u80fd\u529b\u3002\u9ed8\u8ba4\u91cd\u8bd520\u6b21\u3002<\/p>\n

\n

[root@zcwyou ~]# wget --tries=66 https:\/\/wordpress.org\/latest.tar.gz\n<\/code><\/pre>\n<\/p>\n

3.10\u4e00\u6b21\u4e0b\u8f7d\u591a\u4e2a\u6587\u4ef6<\/p>\n

\u5148\u521b\u5efa\u4e00\u4e2a\u6587\u672c\u6587\u4ef6downloadlist.txt\uff0c\u4e0a\u9762\u7684\u5185\u5bb9\u662f\u6253\u7b97\u4e0b\u8f7d\u7684\u6587\u4ef6\u94fe\u63a5\uff1a<\/p>\n

\u4e4b\u540e\u628a\u8fd9\u4e2a\u5217\u8868\u4ea4\u7ed9wget\u5904\u7406<\/p>\n

\n

[root@zcwyou ~]# wget -i downloadlist.txt\n<\/code><\/pre>\n<\/p>\n

3.11\u4e0b\u8f7d\u6574\u4e2a\u7f51\u7ad9\u5185\u5bb9\u5230\u672c\u5730<\/p>\n

\u4f7f\u7528\u53c2\u6570\uff1a--mirror<\/p>\n

\n

[root@zcwyou ~]# wget --mirror -p --convert-links -P .\/qq http:\/\/www.qq.com\n<\/code><\/pre>\n<\/p>\n

-p\u8868\u793a\u53ea\u4e0b\u8f7d\u6b63\u5e38\u7684\u7f51\u9875<\/p>\n

--convert-links\u8868\u793a\u624b\u52a8\u628a\u94fe\u63a5\u8f6c\u4e3a\u672c\u5730<\/p>\n

-P\u524d\u9762\u52a0\u4e00\u4e2a\u76ee\u5f55\u8def\u5f84\uff0c\u5373\u7f51\u7ad9\u5185\u5bb9\u7684\u672c\u5730\u4fdd\u5b58\u4f4d\u7f6e\uff0c\u624b\u52a8\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u540d\u79f0\u81ea\u5b9a\u4e49<\/p>\n

\u9009\u9879--reject\u6307\u5b9a\u4e0d\u4e0b\u8f7d\u7684\u6587\u4ef6\u7c7b\u578b\uff0c\u4f8b\u5982\u4e0d\u4ec5\u56fe\u7247\u5916\uff0c\u4e0b\u8f7d\u5176\u4ed6\u5185\u5bb9<\/p>\n

\n

[root@zcwyou ~]# wget --reject=gif --mirror -p --convert-links -P .\/qq http:\/\/www.qq.com\n<\/code><\/pre>\n<\/p>\n

3.12\u9650\u5236\u4e0b\u8f7d\u7684\u6587\u4ef6\u5927\u5c0f<\/p>\n

\u4f7f\u7528\u9009\u9879-Q\uff0c\u53ea\u5bf9\u9012\u5f52\u6709\u6548\u6216\u5219\u7ed3\u5408--mirror\u4e00\u8d77\u4f7f\u7528\uff0c\u5bf9\u5355\u6587\u4ef6\u65e0\u6548<\/p>\n

3.13\u4e0b\u8f7d\u6307\u5b9a\u6587\u4ef6\u683c\u5f0f<\/p>\n

\u7ed3\u5408\u9012\u5f52\u4e0b\u8f7d\u9009\u9879-r\uff0c\u53ea\u4e0b\u8f7dexe\u6587\u4ef6\u3002<\/p>\n

\n

[root@zcwyou ~]# wget -r -A.exe http:\/\/www.pconline.com.cn\n<\/code><\/pre>\n<\/p>\n

3.14\u8054\u63a5ftp\u670d\u52a1\u5668<\/p>\n

\u533f\u540d\u4e0b\u8f7d<\/p>\n

\n

[root@zcwyou ~]# wget ftp:\/\/www.linuxrumen.com\/qqwechat.exe\n<\/code><\/pre>\n<\/p>\n

\u5e26\u7528\u6237\u540d\u9009\u9879--ftp-user=<\/p>\n

\u5e26\u5bc6\u7801\u9009\u9879--ftp-password=<\/p>\n

\u6bd4\u5982\uff1a\u7528\u6237\u540duser1\uff0c\u5bc6\u7801123<\/p>\n

\n

[root@zcwyou ~]# wget --ftp-user=user1 --ftp-password=123 ftp:\/\/www.linuxrumen.com\/qqwechat.exe\n<\/code><\/pre>\n<\/p>\n

4.\u603b\u7ed3<\/p>\n

wget\u662f\u4e00\u4e2a\u5e38\u7528\u7684\uff0c\u529f\u80fd\u5f3a\u608d\u7684\u547d\u4ee4\u884c\u4e0b\u8f7d\u5de5\u5177\uff0c\u652f\u6301\u591a\u79cd\u5408\u540c\uff0c\u662fLinux\u7cfb\u7edf<\/a>\u6700\u5e38\u7528\u7684\u5de5\u5177\u4e4b\u4e00\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

wget\u662fLinux\u5e73\u53f0\u4e0a\u6700\u5e38\u7528\u7684\u547d\u4ee4\u884c\u4e0b\u8f7d\u5de5\u5177\u4e4b\u4e00\u30022\uff1a\u5b89\u88c5wgetwget.wget-1.\u4e0b\u8f7d\u4e00\u4e2a\u6587\u4ef6\u4f8b\u5b50\uff1a\u628a\u4e0b\u8f7d\u7684\u65e5\u5fd7\u4fdd\u5b58\u5230wget123.\u4f7f\u7528\u9009\u9879–spider\uff0c\u5e76\u4e0d\u4f1a\u771f\u6b63\u4e0b\u8f7d\u6587\u4ef6\u4e00\u6b21\u4e0b\u8f7d\u591a\u4e2a\u6587\u4ef6txt\uff0c\u91cc\u9762\u7684\u5185\u5bb9\u662f\u51c6\u5907\u4e0b\u8f7d\u7684\u6587\u4ef6\u94fe\u63a5\uff1a\u7136\u540e\u628a\u8fd9\u4e2a\u5217\u8868\u4ea4\u7ed9wget\u5904\u7406\u4e0b\u8f7d\u6307\u5b9a\u6587\u4ef6\u683c\u5f0f\u7ed3\u5408\u9012\u5f52\u4e0b\u8f7d\u9009\u9879-r\uff0c\u53ea\u4e0b\u8f7dexe\u6587\u4ef6\u3002<\/p>\n","protected":false},"author":1,"featured_media":264010,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-264009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=264009"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264009\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/264010"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=264009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=264009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=264009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}