⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curl.1

📁 功能最强大的网络爬虫,希望大家好好学习啊,好好研究啊
💻 1
📖 第 1 页 / 共 5 页
字号:
When curl is invoked, it always (unless \fI-q\fP is used) checks for a defaultconfig file and uses it if found. The default config file is checked for inthe following places in this order:1) curl tries to find the "home dir": It first checks for the CURL_HOME andthen the HOME environment variables. Failing that, it uses getpwuid() onunix-like systems (which returns the home dir given the current user in yoursystem). On Windows, it then checks for the APPDATA variable, or as a lastresort the '%USERPROFILE%\Application Data'.2) On windows, if there is no _curlrc file in the home dir, it checks for onein the same dir the executable curl is placed. On unix-like systems, it willsimply try to load .curlrc from the determined home dir..IP "--limit-rate <speed>"Specify the maximum transfer rate you want curl to use. This feature is usefulif you have a limited pipe and you'd like your transfer not use your entirebandwidth.The given speed is measured in bytes/second, unless a suffix is appended.Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes itmegabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.If you are also using the \fI-Y/--speed-limit\fP option, that option will takeprecedence and might cripple the rate-limiting slightly, to help keeping thespeed-limit logic working.If this option is used several times, the last one will be used..IP "-l/--list-only"(FTP)When listing an FTP directory, this switch forces a name-only view.Especially useful if you want to machine-parse the contents of an FTPdirectory since the normal directory view doesn't use a standard lookor format.This option causes an FTP NLST command to be sent.  Some FTP serverslist only files in their response to NLST; they do not includesubdirectories and symbolic links.If this option is used twice, the second will again disable list only..IP "--local-port <num>[-num]"Set a prefered number or range of local port numbers to use for theconnection(s).  Note that port numbers by nature is a scarce resource thatwill be busy at times so setting this range to something too narrow mightcause unnecessary connection setup failures. (Added in 7.15.2).IP "-L/--location"(HTTP/HTTPS) If the server reports that the requested page has moved to adifferent location (indicated with a Location: header and a 3XX response code)this option will make curl redo the request on the new place. If used togetherwith \fI-i/--include\fP or \fI-I/--head\fP, headers from all requested pageswill be shown. When authentication is used, curl only sends its credentials tothe initial host. If a redirect takes curl to a different host, it won't beable to intercept the user+password. See also \fI--location-trusted\fP on howto change this. You can limit the amount of redirects to follow by using the\fI--max-redirs\fP option.If this option is used twice, the second will again disable location following..IP "--location-trusted"(HTTP/HTTPS) Like \fI-L/--location\fP, but will allow sending the name +password to all hosts that the site may redirect to. This may or may notintroduce a security breach if the site redirects you do a site to whichyou'll send your authentication info (which is plaintext in the case of HTTPBasic authentication).If this option is used twice, the second will again disable location following..IP "--max-filesize <bytes>"Specify the maximum size (in bytes) of a file to download. If the filerequested is larger than this value, the transfer will not start and curl willreturn with exit code 63.NOTE: The file size is not always known prior to download, and for such filesthis option has no effect even if the file transfer ends up being larger thanthis given limit. This concerns both FTP and HTTP transfers..IP "-m/--max-time <seconds>"Maximum time in seconds that you allow the whole operation to take.  This isuseful for preventing your batch jobs from hanging for hours due to slownetworks or links going down.  See also the \fI--connect-timeout\fP option.If this option is used several times, the last one will be used..IP "-M/--manual"Manual. Display the huge help text..IP "-n/--netrc"Makes curl scan the \fI.netrc\fP file in the user's home directory for loginname and password. This is typically used for ftp on unix. If used with http,curl will enable user authentication. See.BR netrc(4)or.BR ftp(1)for details on the file format. Curl will not complain if that filehasn't the right permissions (it should not be world nor groupreadable). The environment variable "HOME" is used to find the homedirectory.A quick and very simple example of how to setup a \fI.netrc\fP to allow curlto ftp to the machine host.domain.com with user name \&'myself' and password\&'secret' should look similar to:.B "machine host.domain.com login myself password secret"If this option is used twice, the second will again disable netrc usage..IP "--netrc-optional"Very similar to \fI--netrc\fP, but this option makes the .netrc usage\fBoptional\fP and not mandatory as the \fI--netrc\fP does..IP "--negotiate"(HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method wasdesigned by Microsoft and is used in their web applications. It is primarilymeant as a support for Kerberos5 authentication but may be also used alongwith another authentication methods. For more information see IETF draftdraft-brezak-spnego-http-04.txt.This option requires that the library was built with GSSAPI support. This isnot very common. Use \fI-V/--version\fP to see if your version supportsGSS-Negotiate.When using this option, you must also provide a fake -u/--user option toactivate the authentication code properly. Sending a '-u :' is enough as theuser name and password from the -u option aren't actually used.If this option is used several times, the following occurrences make nodifference..IP "-N/--no-buffer"Disables the buffering of the output stream. In normal work situations, curlwill use a standard buffered output stream that will have the effect that itwill output the data in chunks, not necessarily exactly when the data arrives.Using this option will disable that buffering.If this option is used twice, the second will again switch on buffering..IP "--ntlm"(HTTP) Enables NTLM authentication. The NTLM authentication method wasdesigned by Microsoft and is used by IIS web servers. It is a proprietaryprotocol, reversed engineered by clever people and implemented in curl basedon their efforts. This kind of behavior should not be endorsed, you shouldencourage everyone who uses NTLM to switch to a public and documentedauthentication method instead. Such as Digest.If you want to enable NTLM for your proxy authentication, then use\fI--proxy-ntlm\fP.This option requires that the library was built with SSL support. Use\fI-V/--version\fP to see if your curl supports NTLM.If this option is used several times, the following occurrences make nodifference..IP "-o/--output <file>"Write output to <file> instead of stdout. If you are using {} or [] to fetchmultiple documents, you can use '#' followed by a number in the <file>specifier. That variable will be replaced with the current string for the URLbeing fetched. Like in:  curl http://{one,two}.site.com -o "file_#1.txt"or use several variables like:  curl http://{site,host}.host[1-5].com -o "#1_#2"You may use this option as many times as you have number of URLs.See also the \fI--create-dirs\fP option to create the local directoriesdynamically..IP "-O/--remote-name"Write output to a local file named like the remote file we get. (Only the filepart of the remote file is used, the path is cut off.)The remote file name to use for saving is extracted from the given URL,nothing else.You may use this option as many times as you have number of URLs..IP "--pass <phrase>"(SSL) Pass phrase for the private keyIf this option is used several times, the last one will be used..IP "--proxy-anyauth"Tells curl to pick a suitable authentication method when communicating withthe given proxy. This will cause an extra request/response round-trip. (Addedin 7.13.2)If this option is used twice, the second will again disable the proxy use-anyauthentication..IP "--proxy-basic"Tells curl to use HTTP Basic authentication when communicating with the givenproxy. Use \fI--basic\fP for enabling HTTP Basic with a remote host. Basic isthe default authentication method curl uses with proxies.If this option is used twice, the second will again disable proxy HTTP Basicauthentication..IP "--proxy-digest"Tells curl to use HTTP Digest authentication when communicating with the givenproxy. Use \fI--digest\fP for enabling HTTP Digest with a remote host.If this option is used twice, the second will again disable proxy HTTP Digest..IP "--proxy-ntlm"Tells curl to use HTTP NTLM authentication when communicating with the givenproxy. Use \fI--ntlm\fP for enabling NTLM with a remote host.If this option is used twice, the second will again disable proxy HTTP NTLM..IP "-p/--proxytunnel"When an HTTP proxy is used (\fI-x/--proxy\fP), this option will cause non-HTTPprotocols to attempt to tunnel through the proxy instead of merely using it todo HTTP-like operations. The tunnel approach is made with the HTTP proxyCONNECT request and requires that the proxy allows direct connect to theremote port number curl wants to tunnel through to.If this option is used twice, the second will again disable proxy tunnel..IP "-P/--ftp-port <address>"(FTP) Reverses the initiator/listener roles when connecting with ftp. Thisswitch makes Curl use the PORT command instead of PASV. In practice, PORTtells the server to connect to the client's specified address and port, whilePASV asks the server for an ip address and port to connect to. <address>should be one of:.RS.IP interfacei.e "eth0" to specify which interface's IP address you want to use  (Unix only).IP "IP address"i.e "192.168.10.1" to specify exact IP number.IP "host name"i.e "my.host.domain" to specify machine.IP "-"make curl pick the same IP address that is already used for the controlconnection.REIf this option is used several times, the last one will be used. Disable theuse of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT commandinstead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++..IP "-q"If used as the first parameter on the command line, the \fIcurlrc\fP configfile will not be read and used. See the \fI-K/--config\fP for details on thedefault config file search path..IP "-Q/--quote <command>"(FTP) Send an arbitrary command to the remote FTP server. Quote commands aresent BEFORE the transfer is taking place (just after the initial PWD commandto be exact). To make commands take place after a successful transfer, prefixthem with a dash '-'. To make commands get sent after libcurl has changedworking directory, just before the transfer command(s), prefix the commandwith '+'. You may specify any amount of commands. If the server returnsfailure for one of the commands, the entire operation will be aborted. Youmust send syntactically correct FTP commands as RFC959 defines.This option can be used multiple times..IP "--random-file <file>"(HTTPS) Specify the path name to file containing what will be considered asrandom data. The data is used to seed the random engine for SSL connections.See also the \fI--egd-file\fP option..IP "-r/--range <range>"(HTTP/FTP)Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTPserver. Ranges can be specified in a number of ways..RS.TP 10.B 0-499specifies the first 500 bytes.TP.B 500-999specifies the second 500 bytes.TP.B -500specifies the last 500 bytes.TP.B 9500-specifies the bytes from offset 9500 and forward.TP.B 0-0,-1specifies the first and last byte only(*)(H).TP.B 500-700,600-799specifies 300 bytes from offset 500(H).TP.B 100-199,500-599specifies two separate 100 bytes ranges(*)(H).RE(*) = NOTE that this will cause the server to reply with a multipartresponse!You should also be aware that many HTTP/1.1 servers do not have this featureenabled, so that when you attempt to get a range, you'll instead get the wholedocument.FTP range downloads only support the simple syntax 'start-stop' (optionallywith one of the numbers omitted). It depends on the non-RFC command SIZE.If this option is used several times, the last one will be used..IP "-R/--remote-time"When used, this will make libcurl attempt to figure out the timestamp of theremote file, and if that is available make the local file get that sametimestamp.If this option is used twice, the second time disables this again..IP "--retry <num>"If a transient error is returned when curl tries to perform a transfer, it

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -