{"id":285,"date":"2013-07-17T15:34:55","date_gmt":"2013-07-17T07:34:55","guid":{"rendered":"http:\/\/coderbee.net\/?p=285"},"modified":"2013-07-17T15:34:55","modified_gmt":"2013-07-17T07:34:55","slug":"wget-%e5%a4%87%e5%bf%98","status":"publish","type":"post","link":"https:\/\/coderbee.net\/index.php\/linux\/20130717\/285","title":{"rendered":"wget \u5907\u5fd8"},"content":{"rendered":"<p>\u4eca\u5929\u8981\u4ecegithub\u4e0b\u4e2a\u5e93\u5f88\u6162\uff0c\u7a81\u7136\u6765\u4e86\u8fd9\u4e2a\u547d\u4ee4\uff1a<code>ssh  coderbee@coderbee.net  'wget  https:\/\/github.com\/sbt\/sbt-assembly\/archive\/master.zip  &amp;&amp;  cat  master.zip'  &gt;  master.zip<\/code>\uff0c\u628avps\u5f53\u4f5c\u4e0b\u8f7d\u4e2d\u8f6c\u7ad9\u4e86\uff0c\u901f\u5ea6\u8fd8\u884c\u3002<\/p>\n<p>\u4e0b\u5b8c\u540e\u89c9\u5f97wget\u8fd8\u662f\u5f88nice\u7684\uff0c\u4ee5\u524d\u4e5f\u7528\u6765\u4e0b\u8f7d\u8fc7\u4e00\u4e9bapi\u6587\u6863\uff0c\u591a\u5b66\u4e60\u70b9\u3002<\/p>\n<h2>wget\u4ecb\u7ecd<\/h2>\n<p>wget \u662f\u975e\u4ea4\u4e92\u5f0f\uff08\u53ef\u4ee5\u5728\u540e\u53f0\u8fd0\u884c\uff09\u7684\u7f51\u7edc\u4e0b\u8f7d\u5de5\u5177\uff0c\u652f\u6301\u7684\u534f\u8bae\u6709HTTP\u3001HTTPS\u3001FTP\u3002<\/p>\n<p>wget \u53ef\u4ee5\u89e3\u6790\u5e76\u83b7\u53d6HTML\u3001XHTML\u548cCSS\u9875\u9762\u91cc\u7684\u94fe\u63a5\uff0c\u521b\u5efa\u8fdc\u7a0bweb\u9875\u9762\u7684\u672c\u5730\u7248\u672c\uff0c\u5b8c\u5168\u91cd\u5efa\u539f\u59cb\u9875\u9762\u7684\u76ee\u5f55\u7ed3\u6784\u3002\u53ef\u4ee5\u547d\u4ee4wget\u8f6c\u6362\u5df2\u4e0b\u8f7d\u6587\u4ef6\u91cc\u7684\u94fe\u63a5\u6307\u5411\u672c\u5730\u6587\u4ef6\uff0c\u7528\u4e8e\u79bb\u7ebf\u6d4f\u89c8\u3002<\/p>\n<p>wget\u7684\u5065\u58ee\u6027\u53ef\u7528\u4e8e\u6162\u901f\u6216\u4e0d\u7a33\u5b9a\u7684\u7f51\u7edc\u8fde\u63a5\uff1b\u5982\u679c\u4e0b\u8f7d\u7531\u4e8e\u7f51\u7edc\u95ee\u9898\u5931\u8d25\uff0cwget\u4f1a\u91cd\u8bd5\u76f4\u5230\u6587\u4ef6\u4e0b\u8f7d\u6210\u529f\u3002\u8fd8\u652f\u6301\u65ad\u70b9\u4e0b\u8f7d\uff0c\u5982\u679c\u670d\u52a1\u5668\u652f\u6301\u7684\u8bdd\u3002<\/p>\n<p>\u4f7f\u7528\u65b9\u5f0f\uff1a <code>wget [option]... [URL]...<\/code> \u3002<br \/>\n<!--more--><\/p>\n<h2>\u6709\u7528\u7684\u9009\u9879<\/h2>\n<ul>\n<li><strong><code>-b,  --bacckground<\/code>\uff1a\u542f\u52a8\u540e\u7acb\u5373\u8fdb\u5165\u540e\u53f0\u8fd0\u884c\u3002\u53ef\u4ee5\u7528<code>-o<\/code>\u9009\u9879\u6307\u5b9a\u65e5\u5fd7\u8f93\u51fa\u6587\u4ef6\u3002<\/strong><\/li>\n<li><code>-o  logfile, --output-file=logfile<\/code>\uff1a\u8bb0\u5f55\u6240\u6709\u8f93\u51fa\u4fe1\u606f\u5230logfile\u3002<\/li>\n<li><code>-a  logfile, --append-file=logfile<\/code>\uff1a\u8bb0\u5f55\u6240\u6709\u8f93\u51fa\u4fe1\u606f\u8ffd\u52a0\u5230logfile\u3002<\/li>\n<li><code>-q,  --quiet<\/code>\uff1a\u5c4f\u853dwget\u8f93\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p><strong><code>-i  file,  --input-file=file<\/code>\uff1a\u4ece\u6307\u5b9a\u6587\u4ef6\u8bfb\u53d6url\u3002<\/strong><\/p>\n<\/li>\n<li><code>-F,  --force-html<\/code>\uff1a\u5f3a\u5236\u628a\u8f93\u5165\u6587\u4ef6\u5f53\u4f5cHTML\u6587\u4ef6\uff0c\u8fd9\u6837\u53ef\u4ee5\u89e3\u6790html\u91cc\u7684\u8fde\u63a5\u3002<\/li>\n<li>\n<p><code>-B url,  --base=URL<\/code>\uff1a\u6307\u5b9a\u4e0a\u4e24\u4e2a\u9009\u9879\u91cchtml\u6587\u4ef6\u91cc\u7684\u76f8\u5bf9\u8fde\u63a5\u7684\u57fa\u7840url\u3002\u5982\uff0c\u6307\u5b9a\u57fa\u7840url\u4e3a <code>http:\/\/foo\/bar\/a.html<\/code>\uff0cwget\u4ecehtml\u6587\u4ef6\u8bfb\u53d6\u5230<code>..\/baz\/b.html<\/code>\uff0c\u5c06\u89e3\u6790\u4e3a <code>http:\/\/foo\/baz\/b.html<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p><code>-t  number,  --tries=number<\/code>\uff1a\u8bbe\u7f6e\u91cd\u8bd5\u6b21\u6570\u4e3anumber\uff0c\u5982\u679c\u8bbe\u4e3a0\u6216inf\u8868\u793a\u65e0\u4e0d\u9650\u5236\u3002<\/p>\n<\/li>\n<li><code>-w  seconds,  --wait=seconds<\/code>\uff1a\u4e24\u6b21\u4e0b\u8f7d\u7684\u95f4\u9694\u3002<\/li>\n<li>\n<p><code>-waitretry=seconds<\/code>\uff1a\u5931\u8d25\u540e\u91cd\u8bd5\u7684\u7b49\u5f85\u65f6\u95f4\u3002<\/p>\n<\/li>\n<li>\n<p><strong><code>-c,  --continue<\/code>\uff1a\u7ee7\u7eed\u4e0b\u8f7d\u4e4b\u524d\u5df2\u90e8\u5206\u4e0b\u8f7d\u7684\u6587\u4ef6\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p><code>-T  seconds,  --timeout=seconds<\/code>\uff1a\u8bbe\u7f6e\u7f51\u7edc\u8d85\u65f6\u65f6\u95f4\u4e3aseconds\u79d2\u3002<\/p>\n<\/li>\n<li>\n<p><code>--limit-rate=amount<\/code>\uff1a\u9650\u5236\u4e0b\u8f7d\u901f\u5ea6\u4e3a\u6bcf\u79d2amount\u5b57\u8282\uff0c\u53ef\u4ee5\u540e\u7f00k\u6216m\uff0c\u8868\u793aKB\/s\u3001MB\/s\u3002\u5982\uff1a<code>--limit-rate=20k<\/code> \u3002<\/p>\n<\/li>\n<li>\n<p><code>--user=user<\/code>\uff1a\u6307\u5b9ahttp\u3001ftp\u7684\u7528\u6237\u540d\u3002<\/p>\n<\/li>\n<li>\n<p><code>--password=password<\/code>\uff1a\u6307\u5b9ahttp\u3001ftp\u7684\u7528\u6237\u7684\u5bc6\u7801\u3002<\/p>\n<\/li>\n<li>\n<p><code>-U  agent-string,  --user-agent=agent-string<\/code>\uff1a\u6307\u5b9a\u53d1\u9001\u5230\u670d\u52a1\u5668\u7684user-agent\u3002<\/p>\n<\/li>\n<li>\n<p><code>--post-data=string<\/code>\uff1a\u7528http post\u65b9\u6cd5\u5728\u8bf7\u6c42\u4f53\u53d1\u9001\u5b57\u7b26\u4e32\u5185\u5bb9\u3002<\/p>\n<\/li>\n<li><code>--post-data=file<\/code>\uff1a\u7528http post\u65b9\u6cd5\u5728\u8bf7\u6c42\u4f53\u53d1\u9001\u6587\u4ef6\u5185\u5bb9\u3002\u975emultipart\u65b9\u5f0f\u3002<\/li>\n<\/ul>\n<h3>\u9012\u5f52\u9009\u9879<\/h3>\n<ul>\n<li><strong><code>-r,  --recursive<\/code>\uff1a\u5141\u8bb8\u9012\u5f52\u4e0b\u8f7d\uff0c\u9ed8\u8ba4\u7684\u6700\u5927\u6df1\u5ea6\u662f5\u3002<\/strong><\/li>\n<li>\n<p><strong><code>-l  depth,  --level=depth<\/code>\uff1a\u6307\u5b9a\u9012\u5f52\u7684\u6700\u5927\u6df1\u5ea6\u4e3adepth\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p><strong><code>-k,  --convert-links<\/code>\uff1a\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8f6c\u6362\u6587\u6863\u91cc\u7684\u8fde\u63a5\uff0c\u4f7f\u9002\u5408\u672c\u5730\u6d4f\u89c8\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p><code>-p,  --page-requisites<\/code>\uff1a\u8fd9\u4e2a\u9009\u9879\u4f7fwget\u4e0b\u8f7d\u5c55\u793a\u4e00\u4e2a\u7ed9\u5b9ahtml\u9875\u9762\u6240\u5fc5\u987b\u7684\u6240\u6709\u6587\u4ef6\u3002\u8fd9\u5305\u62ec\u5185\u5d4c\u56fe\u7247\u3001\u97f3\u9891\u548c\u5f15\u7528\u7684\u6837\u5f0f\u6587\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p><code>-np<\/code>\uff1a\u4e0d\u904d\u5386\u7236\u76ee\u5f55\u3002<\/p>\n<\/li>\n<li><code>-nd<\/code>\uff1a\u4e0d\u5728\u672c\u673a\u91cd\u65b0\u521b\u5efa\u76ee\u5f55\u7ed3\u6784\u3002<\/li>\n<\/ul>\n<p>\u52a0\u7c97\u7684\u90e8\u5206\u6211\u89c9\u5f97\u7279\u522b\u6709\u7528\uff0c\u66f4\u591a\u7684\u9009\u9879\u53ef\u4ee5\u67e5\u770bman\u624b\u518c\u3002<\/p>\n<hr\/>\n<p>\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u5fae\u4fe1\u516c\u4f17\u53f7: <strong>coderbee\u7b14\u8bb0<\/strong>\uff0c\u53ef\u4ee5\u66f4\u53ca\u65f6\u56de\u590d\u4f60\u7684\u8ba8\u8bba\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"258\" height=\"258\" src=\"https:\/\/coderbee.net\/wp-content\/uploads\/2019\/01\/coderbee-note.jpg\" class=\"alignnone size-full wp-image-1707\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u8981\u4ecegithub\u4e0b\u4e2a\u5e93\u5f88\u6162\uff0c\u7a81\u7136\u6765\u4e86\u8fd9\u4e2a\u547d\u4ee4\uff1assh coderbee@co &hellip; <a href=\"https:\/\/coderbee.net\/index.php\/linux\/20130717\/285\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[29,65],"_links":{"self":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/285"}],"collection":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/comments?post=285"}],"version-history":[{"count":5,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions"}],"predecessor-version":[{"id":290,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions\/290"}],"wp:attachment":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}