📄 curl.1
字号:
separate file.If this option is used several times, the last one will be used..IP "--key-type <type>"(SSL) Private key file type. Specify which type your \fI--key\fP providedprivate key is. DER, PEM and ENG are supported. If not specified, PEM isassumed.If this option is used several times, the last one will be used..IP "--krb <level>"(FTP) Enable Kerberos authentication and use. The level must be entered andshould be one of 'clear', 'safe', 'confidential' or 'private'. Should you usea level that is not one of these, 'private' will instead be used.This option requires that the library was built with kerberos4 or GSSAPI(GSS-Negotiate) support. This is not very common. Use \fI-V/--version\fP tosee if your curl supports it.If this option is used several times, the last one will be used..IP "-K/--config <config file>"Specify which config file to read curl arguments from. The config file is atext file in which command line arguments can be written which then will beused as if they were written on the actual command line. Options and theirparameters must be specified on the same config file line. If the parameter isto contain white spaces, the parameter must be enclosed within quotes. If thefirst column of a config line is a '#' character, the rest of the line will betreated as a comment. Only write one option per physical line in the configfile.Specify the filename to -K/--config as '-' to make curl read the file fromstdin.Note that to be able to specify a URL in the config file, you need to specifyit using the \fI--url\fP option, and not by simply writing the URL on its ownline. So, it could look similar to this:url = "http://curl.haxx.se/docs/"Long option names can optionally be given in the config file without theinitial double dashes.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..nf# --- Example file ---# this is a commenturl = "curl.haxx.se"output = "curlhere.html"user-agent = "superagent/1.0"# and fetch another URL toourl = "curl.haxx.se/docs/manpage.html"-Oreferer = "http://nowhereatall.com/"# --- End of example file ---.fiThis option can be used multiple times to load multiple config files..IP "--libcurl <file>"Append this option to any ordinary curl command line, and you will get alibcurl-using source code written to the file that does the equivalentoperation of what your command line operation does!NOTE: this does not properly support -F and the sending of multipartformposts, so in those cases the output program will be missing necessarycalls to \fIcurl_formadd(3)\fP, and possibly more.If this option is used several times, the last given file name will be used..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.The given rate is the average speed, counted during the entire transfer. Itmeans that curl might use higher transfer speeds in short bursts, but overtime it uses no more than the given rate.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 preferred 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.When curl follows a redirect and the request is not a plain GET (for examplePOST or PUT), it will do the following request with a GET if the HTTP responsewas 301, 302, or 303. If the response code was any other 3xx code, curl willre-send the following request using the same unmodified method.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.If you want to enable Negotiate for your proxy authentication, then use\fI--proxy-negotiate\fP.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 "--no-sessionid"(SSL) Disable curl's use of SSL session-ID caching. By default all transfersare done using the cache. Note that while nothing ever should get hurt byattempting to reuse SSL session-IDs, there seem to be broken SSLimplementations in the wild that may require you to disable this in order foryou to succeed. (Added in 7.16.0)If this option is used twice, the second will again switch on use of thesession cache..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/SSH) Pass phrase for the private keyIf this option is used several times, the last one will be used..IP "--post301"Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GETrequests when following a 301 redirection. The non-RFC behaviour is ubiquitousin web browsers, so curl does the conversion by default to maintainconsistency. However, a server may requires a POST to remain a POST after sucha redirection. This option is meaningful only when using \fI-L/--location\fP(Added in 7.17.1).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-negotiate"Tells curl to use HTTP Negotiate authentication when communicatingwith the given proxy. Use \fI--negotiate\fP for enabling HTTP Negotiatewith a remote host.If this option is used twice, the second will again disable proxy HTTPNegotiate. (Added in 7.17.1).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-HTTP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -