9e1a6883b37a054089b8d06c83fe040a8a26288e
[platform/upstream/curl.git] / docs / curl.1
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH curl 1 "27 July 2012" "Curl 7.27.0" "Curl Manual"
24 .SH NAME
25 curl \- transfer a URL
26 .SH SYNOPSIS
27 .B curl [options]
28 .I [URL...]
29 .SH DESCRIPTION
30 .B curl
31 is a tool to transfer data from or to a server, using one of the supported
32 protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,
33 LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).  The
34 command is designed to work without user interaction.
35
36 curl offers a busload of useful tricks like proxy support, user
37 authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
38 resume, Metalink, and more. As you will see below, the number of features will
39 make your head spin!
40
41 curl is powered by libcurl for all transfer-related features. See
42 .BR libcurl (3)
43 for details.
44 .SH URL
45 The URL syntax is protocol-dependent. You'll find a detailed description in
46 RFC 3986.
47
48 You can specify multiple URLs or parts of URLs by writing part sets within
49 braces as in:
50
51  http://site.{one,two,three}.com
52
53 or you can get sequences of alphanumeric series by using [] as in:
54
55  ftp://ftp.numericals.com/file[1-100].txt
56  ftp://ftp.numericals.com/file[001-100].txt    (with leading zeros)
57  ftp://ftp.letters.com/file[a-z].txt
58
59 Nested sequences are not supported, but you can use several ones next to each
60 other:
61
62  http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html
63
64 You can specify any amount of URLs on the command line. They will be fetched
65 in a sequential manner in the specified order.
66
67 You can specify a step counter for the ranges to get every Nth number or
68 letter:
69
70  http://www.numericals.com/file[1-100:10].txt
71  http://www.letters.com/file[a-z:2].txt
72
73 If you specify URL without protocol:// prefix, curl will attempt to guess what
74 protocol you might want. It will then default to HTTP but try other protocols
75 based on often-used host name prefixes. For example, for host names starting
76 with "ftp." curl will assume you want to speak FTP.
77
78 curl will do its best to use what you pass to it as a URL. It is not trying to
79 validate it as a syntactically correct URL by any means but is instead
80 \fBvery\fP liberal with what it accepts.
81
82 curl will attempt to re-use connections for multiple file transfers, so that
83 getting many files from the same server will not do multiple connects /
84 handshakes. This improves speed. Of course this is only done on files
85 specified on a single command line and cannot be used between separate curl
86 invokes.
87 .SH "PROGRESS METER"
88 curl normally displays a progress meter during operations, indicating the
89 amount of transferred data, transfer speeds and estimated time left, etc.
90
91 curl displays this data to the terminal by default, so if you invoke curl to
92 do an operation and it is about to write data to the terminal, it
93 \fIdisables\fP the progress meter as otherwise it would mess up the output
94 mixing progress meter and response data.
95
96 If you want a progress meter for HTTP POST or PUT requests, you need to
97 redirect the response output to a file, using shell redirect (>), -o [file] or
98 similar.
99
100 It is not the same case for FTP upload as that operation does not spit out
101 any response data to the terminal.
102
103 If you prefer a progress "bar" instead of the regular meter, \fI-#\fP is your
104 friend.
105 .SH OPTIONS
106 In general, all boolean options are enabled with --\fBoption\fP and yet again
107 disabled with --\fBno-\fPoption. That is, you use the exact same option name
108 but prefix it with "no-". However, in this list we mostly only list and show
109 the --option version of them. (This concept with --no options was added in
110 7.19.0. Previously most options were toggled on/off on repeated use of the
111 same command line option.)
112 .IP "-#, --progress-bar"
113 Make curl display progress as a simple progress bar instead of the standard,
114 more informational, meter.
115 .IP "-0, --http1.0"
116 (HTTP) Forces curl to issue its requests using HTTP 1.0 instead of using its
117 internally preferred: HTTP 1.1.
118 .IP "-1, --tlsv1"
119 (SSL)
120 Forces curl to use TLS version 1 when negotiating with a remote TLS server.
121 .IP "-2, --sslv2"
122 (SSL)
123 Forces curl to use SSL version 2 when negotiating with a remote SSL server.
124 .IP "-3, --sslv3"
125 (SSL)
126 Forces curl to use SSL version 3 when negotiating with a remote SSL server.
127 .IP "-4, --ipv4"
128 If curl is capable of resolving an address to multiple IP versions (which it
129 is if it is IPv6-capable), this option tells curl to resolve names to IPv4
130 addresses only.
131 .IP "-6, --ipv6"
132 If curl is capable of resolving an address to multiple IP versions (which it
133 is if it is IPv6-capable), this option tells curl to resolve names to IPv6
134 addresses only.
135 .IP "-a, --append"
136 (FTP/SFTP) When used in an upload, this will tell curl to append to the target
137 file instead of overwriting it. If the file doesn't exist, it will be created.
138 Note that this flag is ignored by some SSH servers (including OpenSSH).
139 .IP "-A, --user-agent <agent string>"
140 (HTTP) Specify the User-Agent string to send to the HTTP server. Some badly
141 done CGIs fail if this field isn't set to "Mozilla/4.0". To encode blanks in
142 the string, surround the string with single quote marks. This can also be set
143 with the \fI-H, --header\fP option of course.
144
145 If this option is used several times, the last one will be used.
146 .IP "--anyauth"
147 (HTTP) Tells curl to figure out authentication method by itself, and use the
148 most secure one the remote site claims to support. This is done by first
149 doing a request and checking the response-headers, thus possibly inducing an
150 extra network round-trip. This is used instead of setting a specific
151 authentication method, which you can do with \fI--basic\fP, \fI--digest\fP,
152 \fI--ntlm\fP, and \fI--negotiate\fP.
153
154 Note that using --anyauth is not recommended if you do uploads from stdin,
155 since it may require data to be sent twice and then the client must be able to
156 rewind. If the need should arise when uploading from stdin, the upload
157 operation will fail.
158 .IP "-b, --cookie <name=data>"
159 (HTTP)
160 Pass the data to the HTTP server as a cookie. It is supposedly the
161 data previously received from the server in a "Set-Cookie:" line.
162 The data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
163
164 If no '=' symbol is used in the line, it is treated as a filename to use to
165 read previously stored cookie lines from, which should be used in this session
166 if they match. Using this method also activates the "cookie parser" which will
167 make curl record incoming cookies too, which may be handy if you're using this
168 in combination with the \fI-L, --location\fP option. The file format of the
169 file to read cookies from should be plain HTTP headers or the Netscape/Mozilla
170 cookie file format.
171
172 \fBNOTE\fP that the file specified with \fI-b, --cookie\fP is only used as
173 input. No cookies will be stored in the file. To store cookies, use the
174 \fI-c, --cookie-jar\fP option or you could even save the HTTP headers to a file
175 using \fI-D, --dump-header\fP!
176
177 If this option is used several times, the last one will be used.
178 .IP "-B, --use-ascii"
179 (FTP/LDAP) Enable ASCII transfer. For FTP, this can also be
180 enforced by using an URL that ends with ";type=A". This option causes data
181 sent to stdout to be in text mode for win32 systems.
182 .IP "--basic"
183 (HTTP) Tells curl to use HTTP Basic authentication. This is the default and
184 this option is usually pointless, unless you use it to override a previously
185 set option that sets a different authentication method (such as \fI--ntlm\fP,
186 \fI--digest\fP, or \fI--negotiate\fP).
187 .IP "-c, --cookie-jar <file name>"
188 (HTTP) Specify to which file you want curl to write all cookies after a
189 completed operation. Curl writes all cookies previously read from a specified
190 file as well as all cookies received from remote server(s). If no cookies are
191 known, no file will be written. The file will be written using the Netscape
192 cookie file format. If you set the file name to a single dash, "-", the
193 cookies will be written to stdout.
194
195 This command line option will activate the cookie engine that makes curl
196 record and use cookies. Another way to activate it is to use the \fI-b,
197 --cookie\fP option.
198
199 If the cookie jar can't be created or written to, the whole curl operation
200 won't fail or even report an error clearly. Using -v will get a warning
201 displayed, but that is the only visible feedback you get about this possibly
202 lethal situation.
203
204 If this option is used several times, the last specified file name will be
205 used.
206 .IP "-C, --continue-at <offset>"
207 Continue/Resume a previous file transfer at the given offset. The given offset
208 is the exact number of bytes that will be skipped, counting from the beginning
209 of the source file before it is transferred to the destination.  If used with
210 uploads, the FTP server command SIZE will not be used by curl.
211
212 Use "-C -" to tell curl to automatically find out where/how to resume the
213 transfer. It then uses the given output/input files to figure that out.
214
215 If this option is used several times, the last one will be used.
216 .IP "--ciphers <list of ciphers>"
217 (SSL) Specifies which ciphers to use in the connection. The list of ciphers
218 must specify valid ciphers. Read up on SSL cipher list details on this URL:
219 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
220
221 NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of NSS
222 ciphers is in the NSSCipherSuite entry at this URL:
223 \fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
224
225 If this option is used several times, the last one will be used.
226 .IP "--compressed"
227 (HTTP) Request a compressed response using one of the algorithms curl
228 supports, and save the uncompressed document.  If this option is used and the
229 server sends an unsupported encoding, curl will report an error.
230 .IP "--connect-timeout <seconds>"
231 Maximum time in seconds that you allow the connection to the server to take.
232 This only limits the connection phase, once curl has connected this option is
233 of no more use.  Since 7.32.0, this option accepts decimal values, but the
234 actual timeout will decrease in accuracy as the specified timeout increases in
235 decimal precision. See also the \fI-m, --max-time\fP option.
236
237 If this option is used several times, the last one will be used.
238 .IP "--create-dirs"
239 When used in conjunction with the \fI-o\fP option, curl will create the
240 necessary local directory hierarchy as needed. This option creates the dirs
241 mentioned with the \fI-o\fP option, nothing else. If the \fI-o\fP file name
242 uses no dir or if the dirs it mentions already exist, no dir will be created.
243
244 To create remote directories when using FTP or SFTP, try
245 \fI--ftp-create-dirs\fP.
246 .IP "--crlf"
247 (FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
248 .IP "--crlfile <file>"
249 (HTTPS/FTPS) Provide a file using PEM format with a Certificate Revocation
250 List that may specify peer certificates that are to be considered revoked.
251
252 If this option is used several times, the last one will be used.
253
254 (Added in 7.19.7)
255 .IP "-d, --data <data>"
256 (HTTP) Sends the specified data in a POST request to the HTTP server, in the
257 same way that a browser does when a user has filled in an HTML form and
258 presses the submit button. This will cause curl to pass the data to the server
259 using the content-type application/x-www-form-urlencoded.  Compare to
260 \fI-F, --form\fP.
261
262 \fI-d, --data\fP is the same as \fI--data-ascii\fP. To post data purely binary,
263 you should instead use the \fI--data-binary\fP option. To URL-encode the value
264 of a form field you may use \fI--data-urlencode\fP.
265
266 If any of these options is used more than once on the same command line, the
267 data pieces specified will be merged together with a separating
268 &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post
269 chunk that looks like \&'name=daniel&skill=lousy'.
270
271 If you start the data with the letter @, the rest should be a file name to
272 read the data from, or - if you want curl to read the data from stdin.  The
273 contents of the file must already be URL-encoded. Multiple files can also be
274 specified. Posting data from a file named 'foobar' would thus be done with
275 \fI--data @foobar\fP.
276 .IP "-D, --dump-header <file>"
277 Write the protocol headers to the specified file.
278
279 This option is handy to use when you want to store the headers that an HTTP
280 site sends to you. Cookies from the headers could then be read in a second
281 curl invocation by using the \fI-b, --cookie\fP option! The
282 \fI-c, --cookie-jar\fP option is however a better way to store cookies.
283
284 When used in FTP, the FTP server response lines are considered being "headers"
285 and thus are saved there.
286
287 If this option is used several times, the last one will be used.
288
289 .IP "--data-ascii <data>"
290 See \fI-d, --data\fP.
291 .IP "--data-binary <data>"
292 (HTTP) This posts data exactly as specified with no extra processing
293 whatsoever.
294
295 If you start the data with the letter @, the rest should be a filename.  Data
296 is posted in a similar manner as \fI--data-ascii\fP does, except that newlines
297 are preserved and conversions are never done.
298
299 If this option is used several times, the ones following the first will append
300 data as described in \fI-d, --data\fP.
301 .IP "--data-urlencode <data>"
302 (HTTP) This posts data, similar to the other --data options with the exception
303 that this performs URL-encoding. (Added in 7.18.0)
304
305 To be CGI-compliant, the <data> part should begin with a \fIname\fP followed
306 by a separator and a content specification. The <data> part can be passed to
307 curl using one of the following syntaxes:
308 .RS
309 .IP "content"
310 This will make curl URL-encode the content and pass that on. Just be careful
311 so that the content doesn't contain any = or @ symbols, as that will then make
312 the syntax match one of the other cases below!
313 .IP "=content"
314 This will make curl URL-encode the content and pass that on. The preceding =
315 symbol is not included in the data.
316 .IP "name=content"
317 This will make curl URL-encode the content part and pass that on. Note that
318 the name part is expected to be URL-encoded already.
319 .IP "@filename"
320 This will make curl load data from the given file (including any newlines),
321 URL-encode that data and pass it on in the POST.
322 .IP "name@filename"
323 This will make curl load data from the given file (including any newlines),
324 URL-encode that data and pass it on in the POST. The name part gets an equal
325 sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
326 name is expected to be URL-encoded already.
327 .RE
328 .IP "--delegation LEVEL"
329 Set \fILEVEL\fP to tell the server what it is allowed to delegate when it
330 comes to user credentials. Used with GSS/kerberos.
331 .RS
332 .IP "none"
333 Don't allow any delegation.
334 .IP "policy"
335 Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos
336 service ticket, which is a matter of realm policy.
337 .IP "always"
338 Unconditionally allow the server to delegate.
339 .RE
340 .IP "--digest"
341 (HTTP) Enables HTTP Digest authentication. This is an authentication scheme
342 that prevents the password from being sent over the wire in clear text. Use
343 this in combination with the normal \fI-u, --user\fP option to set user name
344 and password. See also \fI--ntlm\fP, \fI--negotiate\fP and \fI--anyauth\fP for
345 related options.
346
347 If this option is used several times, only the first one is used.
348 .IP "--disable-eprt"
349 (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing
350 active FTP transfers. Curl will normally always first attempt to use EPRT,
351 then LPRT before using PORT, but with this option, it will use PORT right
352 away. EPRT and LPRT are extensions to the original FTP protocol, and may not
353 work on all servers, but they enable more functionality in a better way than
354 the traditional PORT command.
355
356 \fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP
357 is an alias for \fB--disable-eprt\fP.
358
359 Disabling EPRT only changes the active behavior. If you want to switch to
360 passive mode you need to not use \fI-P, --ftp-port\fP or force it with
361 \fI--ftp-pasv\fP.
362 .IP "--disable-epsv"
363 (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP
364 transfers. Curl will normally always first attempt to use EPSV before PASV,
365 but with this option, it will not try using EPSV.
366
367 \fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP
368 is an alias for \fB--disable-epsv\fP.
369
370 Disabling EPSV only changes the passive behavior. If you want to switch to
371 active mode you need to use \fI-P, --ftp-port\fP.
372 .IP "-e, --referer <URL>"
373 (HTTP) Sends the "Referer Page" information to the HTTP server. This can also
374 be set with the \fI-H, --header\fP flag of course.  When used with
375 \fI-L, --location\fP you can append ";auto" to the --referer URL to make curl
376 automatically set the previous URL when it follows a Location: header. The
377 \&";auto" string can be used alone, even if you don't set an initial --referer.
378
379 If this option is used several times, the last one will be used.
380 .IP "-E, --cert <certificate[:password]>"
381 (SSL) Tells curl to use the specified client certificate file when getting a
382 file with HTTPS, FTPS or another SSL-based protocol. The certificate must be
383 in PEM format.  If the optional password isn't specified, it will be queried
384 for on the terminal. Note that this option assumes a \&"certificate" file that
385 is the private key and the private certificate concatenated! See \fI--cert\fP
386 and \fI--key\fP to specify them independently.
387
388 If curl is built against the NSS SSL library then this option can tell
389 curl the nickname of the certificate to use within the NSS database defined
390 by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the
391 NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be
392 loaded. If you want to use a file from the current directory, please precede
393 it with "./" prefix, in order to avoid confusion with a nickname.  If the
394 nickname contains ":", it needs to be preceded by "\\" so that it is not
395 recognized as password delimiter.  If the nickname contains "\\", it needs to
396 be escaped as "\\\\" so that it is not recognized as an escape character.
397
398 (iOS and Mac OS X only) If curl is built against Secure Transport, then the
399 certificate string must match the name of a certificate that's in the system or
400 user keychain. The private key corresponding to the certificate, and
401 certificate chain (if any),  must also be present in the keychain.
402
403 If this option is used several times, the last one will be used.
404 .IP "--engine <name>"
405 Select the OpenSSL crypto engine to use for cipher
406 operations. Use \fI--engine list\fP to print a list of build-time supported
407 engines. Note that not all (or none) of the engines may be available at
408 run-time.
409 .IP "--environment"
410 (RISC OS ONLY) Sets a range of environment variables, using the names the
411 \fI-w\fP option supports, to allow easier extraction of useful information
412 after having run curl.
413 .IP "--egd-file <file>"
414 (SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
415 is used to seed the random engine for SSL connections. See also the
416 \fI--random-file\fP option.
417 .IP "--cert-type <type>"
418 (SSL) Tells curl what certificate type the provided certificate is in. PEM,
419 DER and ENG are recognized types.  If not specified, PEM is assumed.
420
421 If this option is used several times, the last one will be used.
422 .IP "--cacert <CA certificate>"
423 (SSL) Tells curl to use the specified certificate file to verify the peer. The
424 file may contain multiple CA certificates. The certificate(s) must be in PEM
425 format. Normally curl is built to use a default file for this, so this option
426 is typically used to alter that default file.
427
428 curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is
429 set, and uses the given path as a path to a CA cert bundle. This option
430 overrides that variable.
431
432 The windows version of curl will automatically look for a CA certs file named
433 \'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in the
434 Current Working Directory, or in any folder along your PATH.
435
436 If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
437 (libnsspem.so) needs to be available for this option to work properly.
438
439 If this option is used several times, the last one will be used.
440 .IP "--capath <CA certificate directory>"
441 (SSL) Tells curl to use the specified certificate directory to verify the
442 peer. Multiple paths can be provided by separating them with ":" (e.g.
443 \&"path1:path2:path3"). The certificates must be in PEM format, and if curl is
444 built against OpenSSL, the directory must have been processed using the
445 c_rehash utility supplied with OpenSSL. Using \fI--capath\fP can allow
446 OpenSSL-powered curl to make SSL-connections much more efficiently than using
447 \fI--cacert\fP if the \fI--cacert\fP file contains many CA certificates.
448
449 If this option is set, the default capath value will be ignored, and if it is
450 used several times, the last one will be used.
451 .IP "-f, --fail"
452 (HTTP) Fail silently (no output at all) on server errors. This is mostly done
453 to better enable scripts etc to better deal with failed attempts. In
454 normal cases when an HTTP server fails to deliver a document, it returns an
455 HTML document stating so (which often also describes why and more). This flag
456 will prevent curl from outputting that and return error 22.
457
458 This method is not fail-safe and there are occasions where non-successful
459 response codes will slip through, especially when authentication is involved
460 (response codes 401 and 407).
461 .IP "-F, --form <name=content>"
462 (HTTP) This lets curl emulate a filled-in form in which a user has pressed the
463 submit button. This causes curl to POST data using the Content-Type
464 multipart/form-data according to RFC 2388. This enables uploading of binary
465 files etc. To force the 'content' part to be a file, prefix the file name
466 with an @ sign. To just get the content part from a file, prefix the file name
467 with the symbol <. The difference between @ and < is then that @ makes a file
468 get attached in the post as a file upload, while the < makes a text field and
469 just get the contents for that text field from a file.
470
471 Example, to send your password file to the server, where
472 \&'password' is the name of the form-field to which /etc/passwd will be the
473 input:
474
475 \fBcurl\fP -F password=@/etc/passwd www.mypasswords.com
476
477 To read content from stdin instead of a file, use - as the filename. This goes
478 for both @ and < constructs.
479
480 You can also tell curl what Content-Type to use by using 'type=', in a manner
481 similar to:
482
483 \fBcurl\fP -F "web=@index.html;type=text/html" url.com
484
485 or
486
487 \fBcurl\fP -F "name=daniel;type=text/foo" url.com
488
489 You can also explicitly change the name field of a file upload part by setting
490 filename=, like this:
491
492 \fBcurl\fP -F "file=@localfile;filename=nameinpost" url.com
493
494 If filename/path contains ',' or ';', it must be quoted by double-quotes like:
495
496 \fBcurl\fP -F "file=@\\"localfile\\";filename=\\"nameinpost\\"" url.com
497
498 or
499
500 \fBcurl\fP -F 'file=@"localfile";filename="nameinpost"' url.com
501
502 Note that if a filename/path is quoted by double-quotes, any double-quote
503 or backslash within the filename must be escaped by backslash.
504
505 See further examples and details in the MANUAL.
506
507 This option can be used multiple times.
508 .IP "--ftp-account [data]"
509 (FTP) When an FTP server asks for "account data" after user name and password
510 has been provided, this data is sent off using the ACCT command. (Added in
511 7.13.0)
512
513 If this option is used several times, the last one will be used.
514 .IP "--ftp-alternative-to-user <command>"
515 (FTP) If authenticating with the USER and PASS commands fails, send this
516 command.  When connecting to Tumbleweed's Secure Transport server over FTPS
517 using a client certificate, using "SITE AUTH" will tell the server to retrieve
518 the username from the certificate. (Added in 7.15.5)
519 .IP "--ftp-create-dirs"
520 (FTP/SFTP) When an FTP or SFTP URL/operation uses a path that doesn't
521 currently exist on the server, the standard behavior of curl is to
522 fail. Using this option, curl will instead attempt to create missing
523 directories.
524 .IP "--ftp-method [method]"
525 (FTP) Control what method curl should use to reach a file on an FTP(S)
526 server. The method argument should be one of the following alternatives:
527 .RS
528 .IP multicwd
529 curl does a single CWD operation for each path part in the given URL. For deep
530 hierarchies this means very many commands. This is how RFC 1738 says it should
531 be done. This is the default but the slowest behavior.
532 .IP nocwd
533 curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full
534 path to the server for all these commands. This is the fastest behavior.
535 .IP singlecwd
536 curl does one CWD with the full target directory and then operates on the file
537 \&"normally" (like in the multicwd case). This is somewhat more standards
538 compliant than 'nocwd' but without the full penalty of 'multicwd'.
539 .RE
540 (Added in 7.15.1)
541 .IP "--ftp-pasv"
542 (FTP) Use passive mode for the data connection. Passive is the internal default
543 behavior, but using this option can be used to override a previous
544 \fI-P/-ftp-port\fP option. (Added in 7.11.0)
545
546 If this option is used several times, only the first one is used. Undoing an
547 enforced passive really isn't doable but you must then instead enforce the
548 correct \fI-P, --ftp-port\fP again.
549
550 Passive mode means that curl will try the EPSV command first and then PASV,
551 unless \fI--disable-epsv\fP is used.
552 .IP "--ftp-skip-pasv-ip"
553 (FTP) Tell curl to not use the IP address the server suggests in its response
554 to curl's PASV command when curl connects the data connection. Instead curl
555 will re-use the same IP address it already uses for the control
556 connection. (Added in 7.14.2)
557
558 This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
559 .IP "--ftp-pret"
560 (FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain
561 FTP servers, mainly drftpd, require this non-standard command for
562 directory listings as well as up and downloads in PASV mode.
563 (Added in 7.20.x)
564 .IP "--ftp-ssl-ccc"
565 (FTP) Use CCC (Clear Command Channel)
566 Shuts down the SSL/TLS layer after authenticating. The rest of the
567 control channel communication will be unencrypted. This allows
568 NAT routers to follow the FTP transaction. The default mode is
569 passive. See \fI--ftp-ssl-ccc-mode\fP for other modes.
570 (Added in 7.16.1)
571 .IP "--ftp-ssl-ccc-mode [active/passive]"
572 (FTP) Use CCC (Clear Command Channel)
573 Sets the CCC mode. The passive mode will not initiate the shutdown, but
574 instead wait for the server to do it, and will not reply to the
575 shutdown from the server. The active mode initiates the shutdown and
576 waits for a reply from the server.
577 (Added in 7.16.2)
578 .IP "--ftp-ssl-control"
579 (FTP) Require SSL/TLS for the FTP login, clear for transfer.  Allows secure
580 authentication, but non-encrypted data transfers for efficiency.  Fails the
581 transfer if the server doesn't support SSL/TLS.  (Added in 7.16.0)
582 that can still be used but will be removed in a future version.
583 .IP "--form-string <name=string>"
584 (HTTP) Similar to \fI--form\fP except that the value string for the named
585 parameter is used literally. Leading \&'@' and \&'<' characters, and the
586 \&';type=' string in the value have no special meaning. Use this in preference
587 to \fI--form\fP if there's any possibility that the string value may
588 accidentally trigger the \&'@' or \&'<' features of \fI--form\fP.
589 .IP "-g, --globoff"
590 This option switches off the "URL globbing parser". When you set this option,
591 you can specify URLs that contain the letters {}[] without having them being
592 interpreted by curl itself. Note that these letters are not normal legal URL
593 contents but they should be encoded according to the URI standard.
594 .IP "-G, --get"
595 When used, this option will make all data specified with \fI-d, --data\fP or
596 \fI--data-binary\fP to be used in an HTTP GET request instead of the POST
597 request that otherwise would be used. The data will be appended to the URL
598 with a '?' separator.
599
600 If used in combination with -I, the POST data will instead be appended to the
601 URL with a HEAD request.
602
603 If this option is used several times, only the first one is used. This is
604 because undoing a GET doesn't make sense, but you should then instead enforce
605 the alternative method you prefer.
606 .IP "-H, --header <header>"
607 (HTTP) Extra header to use when getting a web page. You may specify any number
608 of extra headers. Note that if you should add a custom header that has the
609 same name as one of the internal ones curl would use, your externally set
610 header will be used instead of the internal one. This allows you to make even
611 trickier stuff than curl would normally do. You should not replace internally
612 set headers without knowing perfectly well what you're doing. Remove an
613 internal header by giving a replacement without content on the right side of
614 the colon, as in: -H \&"Host:". If you send the custom header with no-value
615 then its header must be terminated with a semicolon, such as \-H
616 \&"X-Custom-Header;" to send "X-Custom-Header:".
617
618 curl will make sure that each header you add/replace is sent with the proper
619 end-of-line marker, you should thus \fBnot\fP add that as a part of the header
620 content: do not add newlines or carriage returns, they will only mess things up
621 for you.
622
623 See also the \fI-A, --user-agent\fP and \fI-e, --referer\fP options.
624
625 This option can be used multiple times to add/replace/remove multiple headers.
626 .IP "--hostpubmd5 <md5>"
627 (SCP/SFTP) Pass a string containing 32 hexadecimal digits. The string should
628 be the 128 bit MD5 checksum of the remote host's public key, curl will refuse
629 the connection with the host unless the md5sums match. (Added in 7.17.1)
630 .IP "--ignore-content-length"
631 (HTTP)
632 Ignore the Content-Length header. This is particularly useful for servers
633 running Apache 1.x, which will report incorrect Content-Length for files
634 larger than 2 gigabytes.
635 .IP "-i, --include"
636 (HTTP) Include the HTTP-header in the output. The HTTP-header includes things
637 like server-name, date of the document, HTTP-version and more...
638 .IP "-I, --head"
639 (HTTP/FTP/FILE)
640 Fetch the HTTP-header only! HTTP-servers feature the command HEAD
641 which this uses to get nothing but the header of a document. When used
642 on an FTP or FILE file, curl displays the file size and last modification
643 time only.
644 .IP "--interface <name>"
645 Perform an operation using a specified interface. You can enter interface
646 name, IP address or host name. An example could look like:
647
648  curl --interface eth0:1 http://www.netscape.com/
649
650 If this option is used several times, the last one will be used.
651 .IP "-j, --junk-session-cookies"
652 (HTTP) When curl is told to read cookies from a given file, this option will
653 make it discard all "session cookies". This will basically have the same effect
654 as if a new session is started. Typical browsers always discard session
655 cookies when they're closed down.
656 .IP "-J, --remote-header-name"
657 (HTTP) This option tells the \fI-O, --remote-name\fP option to use the
658 server-specified Content-Disposition filename instead of extracting a filename
659 from the URL.
660 .IP "-k, --insecure"
661 (SSL) This option explicitly allows curl to perform "insecure" SSL connections
662 and transfers. All SSL connections are attempted to be made secure by using
663 the CA certificate bundle installed by default. This makes all connections
664 considered "insecure" fail unless \fI-k, --insecure\fP is used.
665
666 See this online resource for further details:
667 \fBhttp://curl.haxx.se/docs/sslcerts.html\fP
668 .IP "-K, --config <config file>"
669 Specify which config file to read curl arguments from. The config file is a
670 text file in which command line arguments can be written which then will be
671 used as if they were written on the actual command line. Options and their
672 parameters must be specified on the same config file line, separated by
673 whitespace, colon, the equals sign or any combination thereof (however,
674 the preferred separator is the equals sign). If the parameter is to contain
675 whitespace, the parameter must be enclosed within quotes. Within double
676 quotes, the following escape sequences are available: \\\\, \\", \\t, \\n,
677 \\r and \\v. A backslash preceding any other letter is ignored. If the
678 first column of a config line is a '#' character, the rest of the line will be
679 treated as a comment. Only write one option per physical line in the config
680 file.
681
682 Specify the filename to -K, --config as '-' to make curl read the file from
683 stdin.
684
685 Note that to be able to specify a URL in the config file, you need to specify
686 it using the \fI--url\fP option, and not by simply writing the URL on its own
687 line. So, it could look similar to this:
688
689 url = "http://curl.haxx.se/docs/"
690
691 Long option names can optionally be given in the config file without the
692 initial double dashes.
693
694 When curl is invoked, it always (unless \fI-q\fP is used) checks for a default
695 config file and uses it if found. The default config file is checked for in
696 the following places in this order:
697
698 1) curl tries to find the "home dir": It first checks for the CURL_HOME and
699 then the HOME environment variables. Failing that, it uses getpwuid() on
700 UNIX-like systems (which returns the home dir given the current user in your
701 system). On Windows, it then checks for the APPDATA variable, or as a last
702 resort the '%USERPROFILE%\\Application Data'.
703
704 2) On windows, if there is no _curlrc file in the home dir, it checks for one
705 in the same dir the curl executable is placed. On UNIX-like systems, it will
706 simply try to load .curlrc from the determined home dir.
707
708 .nf
709 # --- Example file ---
710 # this is a comment
711 url = "curl.haxx.se"
712 output = "curlhere.html"
713 user-agent = "superagent/1.0"
714
715 # and fetch another URL too
716 url = "curl.haxx.se/docs/manpage.html"
717 -O
718 referer = "http://nowhereatall.com/"
719 # --- End of example file ---
720 .fi
721
722 This option can be used multiple times to load multiple config files.
723 .IP "--keepalive-time <seconds>"
724 This option sets the time a connection needs to remain idle before sending
725 keepalive probes and the time between individual keepalive probes. It is
726 currently effective on operating systems offering the TCP_KEEPIDLE and
727 TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This
728 option has no effect if \fI--no-keepalive\fP is used. (Added in 7.18.0)
729
730 If this option is used several times, the last one will be used. If
731 unspecified, the option defaults to 60 seconds.
732 .IP "--key <key>"
733 (SSL/SSH) Private key file name. Allows you to provide your private key in this
734 separate file.
735
736 If this option is used several times, the last one will be used.
737 .IP "--key-type <type>"
738 (SSL) Private key file type. Specify which type your \fI--key\fP provided
739 private key is. DER, PEM, and ENG are supported. If not specified, PEM is
740 assumed.
741
742 If this option is used several times, the last one will be used.
743 .IP "--krb <level>"
744 (FTP) Enable Kerberos authentication and use. The level must be entered and
745 should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use
746 a level that is not one of these, 'private' will instead be used.
747
748 This option requires a library built with kerberos4 or GSSAPI
749 (GSS-Negotiate) support. This is not very common. Use \fI-V, --version\fP to
750 see if your curl supports it.
751
752 If this option is used several times, the last one will be used.
753 .IP "-l, --list-only"
754 (FTP)
755 When listing an FTP directory, this switch forces a name-only view.
756 Especially useful if you want to machine-parse the contents of an FTP
757 directory since the normal directory view doesn't use a standard look
758 or format.
759
760 This option causes an FTP NLST command to be sent.  Some FTP servers
761 list only files in their response to NLST; they do not include
762 subdirectories and symbolic links.
763
764 .IP "-L, --location"
765 (HTTP/HTTPS) If the server reports that the requested page has moved to a
766 different location (indicated with a Location: header and a 3XX response code),
767 this option will make curl redo the request on the new place. If used together
768 with \fI-i, --include\fP or \fI-I, --head\fP, headers from all requested pages
769 will be shown. When authentication is used, curl only sends its credentials to
770 the initial host. If a redirect takes curl to a different host, it won't be
771 able to intercept the user+password. See also \fI--location-trusted\fP on how
772 to change this. You can limit the amount of redirects to follow by using the
773 \fI--max-redirs\fP option.
774
775 When curl follows a redirect and the request is not a plain GET (for example
776 POST or PUT), it will do the following request with a GET if the HTTP response
777 was 301, 302, or 303. If the response code was any other 3xx code, curl will
778 re-send the following request using the same unmodified method.
779 .IP "--libcurl <file>"
780 Append this option to any ordinary curl command line, and you will get a
781 libcurl-using C source code written to the file that does the equivalent
782 of what your command-line operation does!
783
784 If this option is used several times, the last given file name will be
785 used. (Added in 7.16.1)
786 .IP "--limit-rate <speed>"
787 Specify the maximum transfer rate you want curl to use. This feature is useful
788 if you have a limited pipe and you'd like your transfer not to use your entire
789 bandwidth.
790
791 The given speed is measured in bytes/second, unless a suffix is appended.
792 Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it
793 megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
794
795 The given rate is the average speed counted during the entire transfer. It
796 means that curl might use higher transfer speeds in short bursts, but over
797 time it uses no more than the given rate.
798
799 If you also use the \fI-Y, --speed-limit\fP option, that option will take
800 precedence and might cripple the rate-limiting slightly, to help keeping the
801 speed-limit logic working.
802
803 If this option is used several times, the last one will be used.
804 .IP "--local-port <num>[-num]"
805 Set a preferred number or range of local port numbers to use for the
806 connection(s).  Note that port numbers by nature are a scarce resource that
807 will be busy at times so setting this range to something too narrow might
808 cause unnecessary connection setup failures. (Added in 7.15.2)
809 .IP "--location-trusted"
810 (HTTP/HTTPS) Like \fI-L, --location\fP, but will allow sending the name +
811 password to all hosts that the site may redirect to. This may or may not
812 introduce a security breach if the site redirects you to a site to which
813 you'll send your authentication info (which is plaintext in the case of HTTP
814 Basic authentication).
815 .IP "-m, --max-time <seconds>"
816 Maximum time in seconds that you allow the whole operation to take.  This is
817 useful for preventing your batch jobs from hanging for hours due to slow
818 networks or links going down.  Since 7.32.0, this option accepts decimal
819 values, but the actual timeout will decrease in accuracy as the specified
820 timeout increases in decimal precision.  See also the \fI--connect-timeout\fP
821 option.
822
823 If this option is used several times, the last one will be used.
824 .IP "--mail-auth <address>"
825 (SMTP) Specify a single address. This will be used to specify the
826 authentication address (identity) of a submitted message that is being relayed
827 to another server.
828
829 (Added in 7.25.0)
830 .IP "--mail-from <address>"
831 (SMTP) Specify a single address that the given mail should get sent from.
832
833 (Added in 7.20.0)
834 .IP "--max-filesize <bytes>"
835 Specify the maximum size (in bytes) of a file to download. If the file
836 requested is larger than this value, the transfer will not start and curl will
837 return with exit code 63.
838
839 \fBNOTE:\fP The file size is not always known prior to download, and for such
840 files this option has no effect even if the file transfer ends up being larger
841 than this given limit. This concerns both FTP and HTTP transfers.
842 .IP "--mail-rcpt <address>"
843 (SMTP) Specify a single address that the given mail should get sent to. This
844 option can be used multiple times to specify many recipients.
845
846 (Added in 7.20.0)
847 .IP "--max-redirs <num>"
848 Set maximum number of redirection-followings allowed. If \fI-L, --location\fP
849 is used, this option can be used to prevent curl from following redirections
850 \&"in absurdum". By default, the limit is set to 50 redirections. Set this
851 option to -1 to make it limitless.
852
853 If this option is used several times, the last one will be used.
854 .IP "--metalink"
855 This option can tell curl to parse and process a given URI as Metalink file
856 (both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors
857 listed within for failover if there are errors (such as the file or server not
858 being available). It will also verify the hash of the file after the download
859 completes. The Metalink file itself is downloaded and processed in memory and
860 not stored in the local file system.
861
862 Example to use a remote Metalink file:
863
864 \fBcurl\fP --metalink http://www.example.com/example.metalink
865
866 To use a Metalink file in the local file system, use FILE protocol
867 (file://):
868
869 \fBcurl\fP --metalink file://example.metalink
870
871 Please note that if FILE protocol is disabled, there is no way to use
872 a local Metalink file at the time of this writing. Also note that if
873 \fI--metalink\fP and \fI--include\fP are used together, \fI--include\fP will be
874 ignored. This is because including headers in the response will break
875 Metalink parser and if the headers are included in the file described
876 in Metalink file, hash check will fail.
877
878 (Added in 7.27.0, if built against the libmetalink library.)
879 .IP "-n, --netrc"
880 Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
881 home directory for login name and password. This is typically used for FTP on
882 UNIX. If used with HTTP, curl will enable user authentication. See
883 .BR netrc(4)
884 or
885 .BR ftp(1)
886 for details on the file format. Curl will not complain if that file
887 doesn't have the right permissions (it should not be either world- or
888 group-readable). The environment variable "HOME" is used to find the home
889 directory.
890
891 A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
892 to FTP to the machine host.domain.com with user name \&'myself' and password
893 \&'secret' should look similar to:
894
895 .B "machine host.domain.com login myself password secret"
896 .IP "-N, --no-buffer"
897 Disables the buffering of the output stream. In normal work situations, curl
898 will use a standard buffered output stream that will have the effect that it
899 will output the data in chunks, not necessarily exactly when the data arrives.
900 Using this option will disable that buffering.
901
902 Note that this is the negated option name documented. You can thus use
903 \fI--buffer\fP to enforce the buffering.
904 .IP "--netrc-file"
905 This option is similar to \fI--netrc\fP, except that you provide the path
906 (absolute or relative) to the netrc file that Curl should use.
907 You can only specify one netrc file per invocation. If several
908 \fI--netrc-file\fP options are provided, only the \fBlast one\fP will be used.
909 (Added in 7.21.5)
910
911 This option overrides any use of \fI--netrc\fP as they are mutually exclusive.
912 It will also abide by \fI--netrc-optional\fP if specified.
913
914 .IP "--netrc-optional"
915 Very similar to \fI--netrc\fP, but this option makes the .netrc usage
916 \fBoptional\fP and not mandatory as the \fI--netrc\fP option does.
917
918 .IP "--negotiate"
919 (HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was
920 designed by Microsoft and is used in their web applications. It is primarily
921 meant as a support for Kerberos5 authentication but may be also used along
922 with another authentication method. For more information see IETF draft
923 draft-brezak-spnego-http-04.txt.
924
925 If you want to enable Negotiate for your proxy authentication, then use
926 \fI--proxy-negotiate\fP.
927
928 This option requires a library built with GSSAPI support. This is
929 not very common. Use \fI-V, --version\fP to see if your version supports
930 GSS-Negotiate.
931
932 When using this option, you must also provide a fake \fI-u, --user\fP option to
933 activate the authentication code properly. Sending a '-u :' is enough as the
934 user name and password from the \fI-u\fP option aren't actually used.
935
936 If this option is used several times, only the first one is used.
937 .IP "--no-keepalive"
938 Disables the use of keepalive messages on the TCP connection, as by default
939 curl enables them.
940
941 Note that this is the negated option name documented. You can thus use
942 \fI--keepalive\fP to enforce keepalive.
943 .IP "--no-sessionid"
944 (SSL) Disable curl's use of SSL session-ID caching.  By default all transfers
945 are done using the cache. Note that while nothing should ever get hurt by
946 attempting to reuse SSL session-IDs, there seem to be broken SSL
947 implementations in the wild that may require you to disable this in order for
948 you to succeed. (Added in 7.16.0)
949
950 Note that this is the negated option name documented. You can thus use
951 \fI--sessionid\fP to enforce session-ID caching.
952 .IP "--noproxy <no-proxy-list>"
953 Comma-separated list of hosts which do not use a proxy, if one is specified.
954 The only wildcard is a single * character, which matches all hosts, and
955 effectively disables the proxy. Each name in this list is matched as either
956 a domain which contains the hostname, or the hostname itself. For example,
957 local.com would match local.com, local.com:80, and www.local.com, but not
958 www.notlocal.com.  (Added in 7.19.4).
959 .IP "--ntlm"
960 (HTTP) Enables NTLM authentication. The NTLM authentication method was
961 designed by Microsoft and is used by IIS web servers. It is a proprietary
962 protocol, reverse-engineered by clever people and implemented in curl based
963 on their efforts. This kind of behavior should not be endorsed, you should
964 encourage everyone who uses NTLM to switch to a public and documented
965 authentication method instead, such as Digest.
966
967 If you want to enable NTLM for your proxy authentication, then use
968 \fI--proxy-ntlm\fP.
969
970 This option requires a library built with SSL support. Use
971 \fI-V, --version\fP to see if your curl supports NTLM.
972
973 If this option is used several times, only the first one is used.
974 .IP "-o, --output <file>"
975 Write output to <file> instead of stdout. If you are using {} or [] to fetch
976 multiple documents, you can use '#' followed by a number in the <file>
977 specifier. That variable will be replaced with the current string for the URL
978 being fetched. Like in:
979
980   curl http://{one,two}.site.com -o "file_#1.txt"
981
982 or use several variables like:
983
984   curl http://{site,host}.host[1-5].com -o "#1_#2"
985
986 You may use this option as many times as the number of URLs you have.
987
988 See also the \fI--create-dirs\fP option to create the local directories
989 dynamically. Specifying the output as '-' (a single dash) will force the
990 output to be done to stdout.
991 .IP "-O, --remote-name"
992 Write output to a local file named like the remote file we get. (Only the file
993 part of the remote file is used, the path is cut off.)
994
995 The remote file name to use for saving is extracted from the given URL,
996 nothing else.
997
998 Consequentially, the file will be saved in the current working directory. If
999 you want the file saved in a different directory, make sure you change current
1000 working directory before you invoke curl with the \fB-O, --remote-name\fP flag!
1001
1002 You may use this option as many times as the number of URLs you have.
1003 .IP "-p, --proxytunnel"
1004 When an HTTP proxy is used (\fI-x, --proxy\fP), this option will cause non-HTTP
1005 protocols to attempt to tunnel through the proxy instead of merely using it to
1006 do HTTP-like operations. The tunnel approach is made with the HTTP proxy
1007 CONNECT request and requires that the proxy allows direct connect to the
1008 remote port number curl wants to tunnel through to.
1009 .IP "-P, --ftp-port <address>"
1010 (FTP) Reverses the default initiator/listener roles when connecting with
1011 FTP. This switch makes curl use active mode. In practice, curl then tells the
1012 server to connect back to the client's specified address and port, while
1013 passive mode asks the server to setup an IP address and port for it to connect
1014 to. <address> should be one of:
1015 .RS
1016 .IP interface
1017 i.e "eth0" to specify which interface's IP address you want to use (Unix only)
1018 .IP "IP address"
1019 i.e "192.168.10.1" to specify the exact IP address
1020 .IP "host name"
1021 i.e "my.host.domain" to specify the machine
1022 .IP "-"
1023 make curl pick the same IP address that is already used for the control
1024 connection
1025 .RE
1026
1027 If this option is used several times, the last one will be used. Disable the
1028 use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command
1029 instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
1030
1031 Starting in 7.19.5, you can append \&":[start]-[end]\&" to the right of the
1032 address, to tell curl what TCP port range to use. That means you specify a
1033 port range, from a lower to a higher number. A single number works as well,
1034 but do note that it increases the risk of failure since the port may not be
1035 available.
1036 .IP "--pass <phrase>"
1037 (SSL/SSH) Passphrase for the private key
1038
1039 If this option is used several times, the last one will be used.
1040 .IP "--post301"
1041 (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
1042 into GET requests when following a 301 redirection. The non-RFC behaviour is
1043 ubiquitous in web browsers, so curl does the conversion by default to maintain
1044 consistency. However, a server may require a POST to remain a POST after such
1045 a redirection. This option is meaningful only when using \fI-L, --location\fP
1046 (Added in 7.17.1)
1047 .IP "--post302"
1048 (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
1049 into GET requests when following a 302 redirection. The non-RFC behaviour is
1050 ubiquitous in web browsers, so curl does the conversion by default to maintain
1051 consistency. However, a server may require a POST to remain a POST after such
1052 a redirection. This option is meaningful only when using \fI-L, --location\fP
1053 (Added in 7.19.1)
1054 .IP "--post303"
1055 (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
1056 into GET requests when following a 303 redirection. The non-RFC behaviour is
1057 ubiquitous in web browsers, so curl does the conversion by default to maintain
1058 consistency. However, a server may require a POST to remain a POST after such
1059 a redirection. This option is meaningful only when using \fI-L, --location\fP
1060 (Added in 7.26.0)
1061 .IP "--proto <protocols>"
1062 Tells curl to use the listed protocols for its initial retrieval. Protocols
1063 are evaluated left to right, are comma separated, and are each a protocol
1064 name or 'all', optionally prefixed by zero or more modifiers. Available
1065 modifiers are:
1066 .RS
1067 .TP 3
1068 .B +
1069 Permit this protocol in addition to protocols already permitted (this is
1070 the default if no modifier is used).
1071 .TP
1072 .B -
1073 Deny this protocol, removing it from the list of protocols already permitted.
1074 .TP
1075 .B =
1076 Permit only this protocol (ignoring the list already permitted), though
1077 subject to later modification by subsequent entries in the comma separated
1078 list.
1079 .RE
1080 .IP
1081 For example:
1082 .RS
1083 .TP 15
1084 .B --proto -ftps
1085 uses the default protocols, but disables ftps
1086 .TP
1087 .B  --proto -all,https,+http
1088 only enables http and https
1089 .TP
1090 .B --proto =http,https
1091 also only enables http and https
1092 .RE
1093 .IP
1094 Unknown protocols produce a warning. This allows scripts to safely rely on
1095 being able to disable potentially dangerous protocols, without relying upon
1096 support for that protocol being built into curl to avoid an error.
1097
1098 This option can be used multiple times, in which case the effect is the same
1099 as concatenating the protocols into one instance of the option.
1100
1101 (Added in 7.20.2)
1102 .IP "--proto-redir <protocols>"
1103 Tells curl to use the listed protocols after a redirect. See --proto for
1104 how protocols are represented.
1105
1106 (Added in 7.20.2)
1107 .IP "--proxy-anyauth"
1108 Tells curl to pick a suitable authentication method when communicating with
1109 the given proxy. This might cause an extra request/response round-trip. (Added
1110 in 7.13.2)
1111 .IP "--proxy-basic"
1112 Tells curl to use HTTP Basic authentication when communicating with the given
1113 proxy. Use \fI--basic\fP for enabling HTTP Basic with a remote host. Basic is
1114 the default authentication method curl uses with proxies.
1115 .IP "--proxy-digest"
1116 Tells curl to use HTTP Digest authentication when communicating with the given
1117 proxy. Use \fI--digest\fP for enabling HTTP Digest with a remote host.
1118 .IP "--proxy-negotiate"
1119 Tells curl to use HTTP Negotiate authentication when communicating
1120 with the given proxy. Use \fI--negotiate\fP for enabling HTTP Negotiate
1121 with a remote host. (Added in 7.17.1)
1122 .IP "--proxy-ntlm"
1123 Tells curl to use HTTP NTLM authentication when communicating with the given
1124 proxy. Use \fI--ntlm\fP for enabling NTLM with a remote host.
1125 .IP "--proxy1.0 <proxyhost[:port]>"
1126 Use the specified HTTP 1.0 proxy. If the port number is not specified, it is
1127 assumed at port 1080.
1128
1129 The only difference between this and the HTTP proxy option (\fI-x, --proxy\fP),
1130 is that attempts to use CONNECT through the proxy will specify an HTTP 1.0
1131 protocol instead of the default HTTP 1.1.
1132 .IP "--pubkey <key>"
1133 (SSH) Public key file name. Allows you to provide your public key in this
1134 separate file.
1135
1136 If this option is used several times, the last one will be used.
1137 .IP "-q"
1138 If used as the first parameter on the command line, the \fIcurlrc\fP config
1139 file will not be read and used. See the \fI-K, --config\fP for details on the
1140 default config file search path.
1141 .IP "-Q, --quote <command>"
1142 (FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote
1143 commands are sent BEFORE the transfer takes place (just after the initial PWD
1144 command in an FTP transfer, to be exact). To make commands take place after a
1145 successful transfer, prefix them with a dash '-'.  To make commands be sent
1146 after curl has changed the working directory, just before the transfer
1147 command(s), prefix the command with a '+' (this is only supported for
1148 FTP). You may specify any number of commands. If the server returns failure
1149 for one of the commands, the entire operation will be aborted. You must send
1150 syntactically correct FTP commands as RFC 959 defines to FTP servers, or one
1151 of the commands listed below to SFTP servers.  This option can be used
1152 multiple times. When speaking to an FTP server, prefix the command with an
1153 asterisk (*) to make curl continue even if the command fails as by default
1154 curl will stop at first failure.
1155
1156 SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
1157 itself before sending them to the server.  File names may be quoted
1158 shell-style to embed spaces or special characters.  Following is the list of
1159 all supported SFTP quote commands:
1160 .RS
1161 .IP "chgrp group file"
1162 The chgrp command sets the group ID of the file named by the file operand to
1163 the group ID specified by the group operand. The group operand is a decimal
1164 integer group ID.
1165 .IP "chmod mode file"
1166 The chmod command modifies the file mode bits of the specified file. The
1167 mode operand is an octal integer mode number.
1168 .IP "chown user file"
1169 The chown command sets the owner of the file named by the file operand to the
1170 user ID specified by the user operand. The user operand is a decimal
1171 integer user ID.
1172 .IP "ln source_file target_file"
1173 The ln and symlink commands create a symbolic link at the target_file location
1174 pointing to the source_file location.
1175 .IP "mkdir directory_name"
1176 The mkdir command creates the directory named by the directory_name operand.
1177 .IP "pwd"
1178 The pwd command returns the absolute pathname of the current working directory.
1179 .IP "rename source target"
1180 The rename command renames the file or directory named by the source
1181 operand to the destination path named by the target operand.
1182 .IP "rm file"
1183 The rm command removes the file specified by the file operand.
1184 .IP "rmdir directory"
1185 The rmdir command removes the directory entry specified by the directory
1186 operand, provided it is empty.
1187 .IP "symlink source_file target_file"
1188 See ln.
1189 .RE
1190 .IP "-r, --range <range>"
1191 (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial document) from a
1192 HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified
1193 in a number of ways.
1194 .RS
1195 .TP 10
1196 .B 0-499
1197 specifies the first 500 bytes
1198 .TP
1199 .B 500-999
1200 specifies the second 500 bytes
1201 .TP
1202 .B -500
1203 specifies the last 500 bytes
1204 .TP
1205 .B 9500-
1206 specifies the bytes from offset 9500 and forward
1207 .TP
1208 .B 0-0,-1
1209 specifies the first and last byte only(*)(H)
1210 .TP
1211 .B 500-700,600-799
1212 specifies 300 bytes from offset 500(H)
1213 .TP
1214 .B 100-199,500-599
1215 specifies two separate 100-byte ranges(*)(H)
1216 .RE
1217
1218 (*) = NOTE that this will cause the server to reply with a multipart
1219 response!
1220
1221 Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
1222 \&'start-stop' range syntax. If a non-digit character is given in the range,
1223 the server's response will be unspecified, depending on the server's
1224 configuration.
1225
1226 You should also be aware that many HTTP/1.1 servers do not have this feature
1227 enabled, so that when you attempt to get a range, you'll instead get the whole
1228 document.
1229
1230 FTP and SFTP range downloads only support the simple 'start-stop' syntax
1231 (optionally with one of the numbers omitted). FTP use depends on the extended
1232 FTP command SIZE.
1233
1234 If this option is used several times, the last one will be used.
1235 .IP "-R, --remote-time"
1236 When used, this will make curl attempt to figure out the timestamp of the
1237 remote file, and if that is available make the local file get that same
1238 timestamp.
1239 .IP "--random-file <file>"
1240 (SSL) Specify the path name to file containing what will be considered as
1241 random data. The data is used to seed the random engine for SSL connections.
1242 See also the \fI--egd-file\fP option.
1243 .IP "--raw"
1244 (HTTP) When used, it disables all internal HTTP decoding of content or transfer
1245 encodings and instead makes them passed on unaltered, raw. (Added in 7.16.2)
1246 .IP "--remote-name-all"
1247 This option changes the default action for all given URLs to be dealt with as
1248 if \fI-O, --remote-name\fP were used for each one. So if you want to disable
1249 that for a specific URL after \fI--remote-name-all\fP has been used, you must
1250 use "-o -" or \fI--no-remote-name\fP. (Added in 7.19.0)
1251 .IP "--resolve <host:port:address>"
1252 Provide a custom address for a specific host and port pair. Using this, you
1253 can make the curl requests(s) use a specified address and prevent the
1254 otherwise normally resolved address to be used. Consider it a sort of
1255 /etc/hosts alternative provided on the command line. The port number should be
1256 the number used for the specific protocol the host will be used for. It means
1257 you need several entries if you want to provide address for the same host but
1258 different ports.
1259
1260 This option can be used many times to add many host names to resolve.
1261
1262 (Added in 7.21.3)
1263 .IP "--retry <num>"
1264 If a transient error is returned when curl tries to perform a transfer, it
1265 will retry this number of times before giving up. Setting the number to 0
1266 makes curl do no retries (which is the default). Transient error means either:
1267 a timeout, an FTP 4xx response code or an HTTP 5xx response code.
1268
1269 When curl is about to retry a transfer, it will first wait one second and then
1270 for all forthcoming retries it will double the waiting time until it reaches
1271 10 minutes which then will be the delay between the rest of the retries.  By
1272 using \fI--retry-delay\fP you disable this exponential backoff algorithm. See
1273 also \fI--retry-max-time\fP to limit the total time allowed for
1274 retries. (Added in 7.12.3)
1275
1276 If this option is used several times, the last one will be used.
1277 .IP "--retry-delay <seconds>"
1278 Make curl sleep this amount of time before each retry when a transfer has
1279 failed with a transient error (it changes the default backoff time algorithm
1280 between retries). This option is only interesting if \fI--retry\fP is also
1281 used. Setting this delay to zero will make curl use the default backoff time.
1282 (Added in 7.12.3)
1283
1284 If this option is used several times, the last one will be used.
1285 .IP "--retry-max-time <seconds>"
1286 The retry timer is reset before the first transfer attempt. Retries will be
1287 done as usual (see \fI--retry\fP) as long as the timer hasn't reached this
1288 given limit. Notice that if the timer hasn't reached the limit, the request
1289 will be made and while performing, it may take longer than this given time
1290 period. To limit a single request\'s maximum time, use \fI-m, --max-time\fP.
1291 Set this option to zero to not timeout retries. (Added in 7.12.3)
1292
1293 If this option is used several times, the last one will be used.
1294 .IP "-s, --silent"
1295 Silent or quiet mode. Don't show progress meter or error messages.  Makes Curl
1296 mute. It will still output the data you ask for, potentially even to the
1297 terminal/stdout unless you redirect it.
1298 .IP "--sasl-ir"
1299 Enable initial response in SASL authentication.
1300 (Added in 7.31.0)
1301 .IP "-S, --show-error"
1302 When used with \fI-s\fP it makes curl show an error message if it fails.
1303 .IP "--ssl"
1304 (FTP, POP3, IMAP, SMTP) Try to use SSL/TLS for the connection.  Reverts to a
1305 non-secure connection if the server doesn't support SSL/TLS.  See also
1306 \fI--ftp-ssl-control\fP and \fI--ssl-reqd\fP for different levels of
1307 encryption required. (Added in 7.20.0)
1308
1309 This option was formerly known as \fI--ftp-ssl\fP (Added in 7.11.0). That
1310 option name can still be used but will be removed in a future version.
1311 .IP "--ssl-reqd"
1312 (FTP, POP3, IMAP, SMTP) Require SSL/TLS for the connection.  Terminates the
1313 connection if the server doesn't support SSL/TLS. (Added in 7.20.0)
1314
1315 This option was formerly known as \fI--ftp-ssl-reqd\fP (added in 7.15.5). That
1316 option name can still be used but will be removed in a future version.
1317 .IP "--ssl-allow-beast"
1318 (SSL) This option tells curl to not work around a security flaw in the SSL3
1319 and TLS1.0 protocols known as BEAST.  If this option isn't used, the SSL layer
1320 may use work-arounds known to cause interoperability problems with some older
1321 SSL implementations. WARNING: this option loosens the SSL security, and by
1322 using this flag you ask for exactly that.  (Added in 7.25.0)
1323 .IP "--socks4 <host[:port]>"
1324 Use the specified SOCKS4 proxy. If the port number is not specified, it is
1325 assumed at port 1080. (Added in 7.15.2)
1326
1327 This option overrides any previous use of \fI-x, --proxy\fP, as they are
1328 mutually exclusive.
1329
1330 Since 7.21.7, this option is superfluous since you can specify a socks4 proxy
1331 with \fI-x, --proxy\fP using a socks4:// protocol prefix.
1332
1333 If this option is used several times, the last one will be used.
1334 .IP "--socks4a <host[:port]>"
1335 Use the specified SOCKS4a proxy. If the port number is not specified, it is
1336 assumed at port 1080. (Added in 7.18.0)
1337
1338 This option overrides any previous use of \fI-x, --proxy\fP, as they are
1339 mutually exclusive.
1340
1341 Since 7.21.7, this option is superfluous since you can specify a socks4a proxy
1342 with \fI-x, --proxy\fP using a socks4a:// protocol prefix.
1343
1344 If this option is used several times, the last one will be used.
1345 .IP "--socks5-hostname <host[:port]>"
1346 Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If
1347 the port number is not specified, it is assumed at port 1080. (Added in
1348 7.18.0)
1349
1350 This option overrides any previous use of \fI-x, --proxy\fP, as they are
1351 mutually exclusive.
1352
1353 Since 7.21.7, this option is superfluous since you can specify a socks5
1354 hostname proxy with \fI-x, --proxy\fP using a socks5h:// protocol prefix.
1355
1356 If this option is used several times, the last one will be used. (This option
1357 was previously wrongly documented and used as --socks without the number
1358 appended.)
1359 .IP "--socks5 <host[:port]>"
1360 Use the specified SOCKS5 proxy - but resolve the host name locally. If the
1361 port number is not specified, it is assumed at port 1080.
1362
1363 This option overrides any previous use of \fI-x, --proxy\fP, as they are
1364 mutually exclusive.
1365
1366 Since 7.21.7, this option is superfluous since you can specify a socks5 proxy
1367 with \fI-x, --proxy\fP using a socks5:// protocol prefix.
1368
1369 If this option is used several times, the last one will be used. (This option
1370 was previously wrongly documented and used as --socks without the number
1371 appended.)
1372
1373 This option (as well as \fI--socks4\fP) does not work with IPV6, FTPS or LDAP.
1374 .IP "--socks5-gssapi-service <servicename>"
1375 The default service name for a socks server is rcmd/server-fqdn. This option
1376 allows you to change it.
1377
1378 Examples: --socks5 proxy-name \fI--socks5-gssapi-service\fP sockd would use
1379 sockd/proxy-name --socks5 proxy-name \fI--socks5-gssapi-service\fP
1380 sockd/real-name would use sockd/real-name for cases where the proxy-name does
1381 not match the principal name.  (Added in 7.19.4).
1382 .IP "--socks5-gssapi-nec"
1383 As part of the gssapi negotiation a protection mode is negotiated. RFC 1961
1384 says in section 4.3/4.4 it should be protected, but the NEC reference
1385 implementation does not.  The option \fI--socks5-gssapi-nec\fP allows the
1386 unprotected exchange of the protection mode negotiation. (Added in 7.19.4).
1387 .IP "--stderr <file>"
1388 Redirect all writes to stderr to the specified file instead. If the file name
1389 is a plain '-', it is instead written to stdout.
1390
1391 If this option is used several times, the last one will be used.
1392 .IP "-t, --telnet-option <OPT=val>"
1393 Pass options to the telnet protocol. Supported options are:
1394
1395 TTYPE=<term> Sets the terminal type.
1396
1397 XDISPLOC=<X display> Sets the X display location.
1398
1399 NEW_ENV=<var,val> Sets an environment variable.
1400 .IP "-T, --upload-file <file>"
1401 This transfers the specified local file to the remote URL. If there is no file
1402 part in the specified URL, Curl will append the local file name. NOTE that you
1403 must use a trailing / on the last directory to really prove to Curl that there
1404 is no file name or curl will think that your last directory name is the remote
1405 file name to use. That will most likely cause the upload operation to fail. If
1406 this is used on an HTTP(S) server, the PUT command will be used.
1407
1408 Use the file name "-" (a single dash) to use stdin instead of a given file.
1409 Alternately, the file name "." (a single period) may be specified instead
1410 of "-" to use stdin in non-blocking mode to allow reading server output
1411 while stdin is being uploaded.
1412
1413 You can specify one -T for each URL on the command line. Each -T + URL pair
1414 specifies what to upload and to where. curl also supports "globbing" of the -T
1415 argument, meaning that you can upload multiple files to a single URL by using
1416 the same URL globbing style supported in the URL, like this:
1417
1418 curl -T "{file1,file2}" http://www.uploadtothissite.com
1419
1420 or even
1421
1422 curl -T "img[1-1000].png" ftp://ftp.picturemania.com/upload/
1423 .IP "--tcp-nodelay"
1424 Turn on the TCP_NODELAY option. See the \fIcurl_easy_setopt(3)\fP man page for
1425 details about this option. (Added in 7.11.2)
1426 .IP "--tftp-blksize <value>"
1427 (TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that
1428 curl will try to use when transferring data to or from a TFTP server. By
1429 default 512 bytes will be used.
1430
1431 If this option is used several times, the last one will be used.
1432
1433 (Added in 7.20.0)
1434 .IP "--tlsauthtype <authtype>"
1435 Set TLS authentication type. Currently, the only supported option is "SRP",
1436 for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are
1437 specified but \fI--tlsauthtype\fP is not, then this option defaults to "SRP".
1438 (Added in 7.21.4)
1439 .IP "--tlsuser <user>"
1440 Set username for use with the TLS authentication method specified with
1441 \fI--tlsauthtype\fP. Requires that \fI--tlspassword\fP also be set.  (Added in
1442 7.21.4)
1443 .IP "--tlspassword <password>"
1444 Set password for use with the TLS authentication method specified with
1445 \fI--tlsauthtype\fP. Requires that \fI--tlsuser\fP also be set.  (Added in
1446 7.21.4)
1447 .IP "--tr-encoding"
1448 (HTTP) Request a compressed Transfer-Encoding response using one of the
1449 algorithms curl supports, and uncompress the data while receiving it.
1450
1451 (Added in 7.21.6)
1452 .IP "--trace <file>"
1453 Enables a full trace dump of all incoming and outgoing data, including
1454 descriptive information, to the given output file. Use "-" as filename to have
1455 the output sent to stdout.
1456
1457 This option overrides previous uses of \fI-v, --verbose\fP or
1458 \fI--trace-ascii\fP.
1459
1460 If this option is used several times, the last one will be used.
1461 .IP "--trace-ascii <file>"
1462 Enables a full trace dump of all incoming and outgoing data, including
1463 descriptive information, to the given output file. Use "-" as filename to have
1464 the output sent to stdout.
1465
1466 This is very similar to \fI--trace\fP, but leaves out the hex part and only
1467 shows the ASCII part of the dump. It makes smaller output that might be easier
1468 to read for untrained humans.
1469
1470 This option overrides previous uses of \fI-v, --verbose\fP or \fI--trace\fP.
1471
1472 If this option is used several times, the last one will be used.
1473 .IP "--trace-time"
1474 Prepends a time stamp to each trace or verbose line that curl displays.
1475 (Added in 7.14.0)
1476 .IP "-u, --user <user:password>"
1477 Specify the user name and password to use for server authentication. Overrides
1478 \fI-n, --netrc\fP and \fI--netrc-optional\fP.
1479
1480 If you just give the user name (without entering a colon) curl will prompt for
1481 a password.
1482
1483 If you use an SSPI-enabled curl binary and do NTLM authentication, you can
1484 force curl to pick up the user name and password from your environment by
1485 simply specifying a single colon with this option: "-u :".
1486
1487 If this option is used several times, the last one will be used.
1488 .IP "-U, --proxy-user <user:password>"
1489 Specify the user name and password to use for proxy authentication.
1490
1491 If you use an SSPI-enabled curl binary and do NTLM authentication, you can
1492 force curl to pick up the user name and password from your environment by
1493 simply specifying a single colon with this option: "-U :".
1494
1495 If this option is used several times, the last one will be used.
1496 .IP "--url <URL>"
1497 Specify a URL to fetch. This option is mostly handy when you want to specify
1498 URL(s) in a config file.
1499
1500 This option may be used any number of times. To control where this URL is
1501 written, use the \fI-o, --output\fP or the \fI-O, --remote-name\fP options.
1502 .IP "-v, --verbose"
1503 Makes the fetching more verbose/talkative. Mostly useful for debugging. A line
1504 starting with '>' means "header data" sent by curl, '<' means "header data"
1505 received by curl that is hidden in normal cases, and a line starting with '*'
1506 means additional info provided by curl.
1507
1508 Note that if you only want HTTP headers in the output, \fI-i, --include\fP
1509 might be the option you're looking for.
1510
1511 If you think this option still doesn't give you enough details, consider using
1512 \fI--trace\fP or \fI--trace-ascii\fP instead.
1513
1514 This option overrides previous uses of \fI--trace-ascii\fP or \fI--trace\fP.
1515
1516 Use \fI-s, --silent\fP to make curl quiet.
1517 .IP "-w, --write-out <format>"
1518 Defines what to display on stdout after a completed and successful
1519 operation. The format is a string that may contain plain text mixed with any
1520 number of variables. The string can be specified as "string", to get read from
1521 a particular file you specify it "@filename" and to tell curl to read the
1522 format from stdin you write "@-".
1523
1524 The variables present in the output format will be substituted by the value or
1525 text that curl thinks fit, as described below. All variables are specified
1526 as %{variable_name} and to output a normal % you just write them as
1527 %%. You can output a newline by using \\n, a carriage return with \\r and a tab
1528 space with \\t.
1529
1530 .B NOTE:
1531 The %-symbol is a special symbol in the win32-environment, where all
1532 occurrences of % must be doubled when using this option.
1533
1534 The variables available are:
1535 .RS
1536 .TP 15
1537 .B content_type
1538 The Content-Type of the requested document, if there was any.
1539 .TP
1540 .B filename_effective
1541 The ultimate filename that curl writes out to. This is only meaningful if curl
1542 is told to write to a file with the \fI--remote-name\fP or \fI--output\fP
1543 option. It's most useful in combination with the \fI--remote-header-name\fP
1544 option. (Added in 7.25.1)
1545 .TP
1546 .B ftp_entry_path
1547 The initial path curl ended up in when logging on to the remote FTP
1548 server. (Added in 7.15.4)
1549 .TP
1550 .B http_code
1551 The numerical response code that was found in the last retrieved HTTP(S) or
1552 FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the
1553 same info.
1554 .TP
1555 .B http_connect
1556 The numerical code that was found in the last response (from a proxy) to a
1557 curl CONNECT request. (Added in 7.12.4)
1558 .TP
1559 .B local_ip
1560 The IP address of the local end of the most recently done connection - can be
1561 either IPv4 or IPv6 (Added in 7.29.0)
1562 .TP
1563 .B local_port
1564 The local port number of the most recently done connection (Added in 7.29.0)
1565 .TP
1566 .B num_connects
1567 Number of new connects made in the recent transfer. (Added in 7.12.3)
1568 .TP
1569 .B num_redirects
1570 Number of redirects that were followed in the request. (Added in 7.12.3)
1571 .TP
1572 .B redirect_url
1573 When an HTTP request was made without -L to follow redirects, this variable
1574 will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2)
1575 .TP
1576 .B remote_ip
1577 The remote IP address of the most recently done connection - can be either
1578 IPv4 or IPv6 (Added in 7.29.0)
1579 .TP
1580 .B remote_port
1581 The remote port number of the most recently done connection (Added in 7.29.0)
1582 .TP
1583 .B size_download
1584 The total amount of bytes that were downloaded.
1585 .TP
1586 .B size_header
1587 The total amount of bytes of the downloaded headers.
1588 .TP
1589 .B size_request
1590 The total amount of bytes that were sent in the HTTP request.
1591 .TP
1592 .B size_upload
1593 The total amount of bytes that were uploaded.
1594 .TP
1595 .B speed_download
1596 The average download speed that curl measured for the complete download. Bytes
1597 per second.
1598 .TP
1599 .B speed_upload
1600 The average upload speed that curl measured for the complete upload. Bytes per
1601 second.
1602 .TP
1603 .B ssl_verify_result
1604 The result of the SSL peer certificate verification that was requested. 0
1605 means the verification was successful. (Added in 7.19.0)
1606 .TP
1607 .B time_appconnect
1608 The time, in seconds, it took from the start until the SSL/SSH/etc
1609 connect/handshake to the remote host was completed. (Added in 7.19.0)
1610 .TP
1611 .B time_connect
1612 The time, in seconds, it took from the start until the TCP connect to the
1613 remote host (or proxy) was completed.
1614 .TP
1615 .B time_namelookup
1616 The time, in seconds, it took from the start until the name resolving was
1617 completed.
1618 .TP
1619 .B time_pretransfer
1620 The time, in seconds, it took from the start until the file transfer was just
1621 about to begin. This includes all pre-transfer commands and negotiations that
1622 are specific to the particular protocol(s) involved.
1623 .TP
1624 .B time_redirect
1625 The time, in seconds, it took for all redirection steps include name lookup,
1626 connect, pretransfer and transfer before the final transaction was
1627 started. time_redirect shows the complete execution time for multiple
1628 redirections. (Added in 7.12.3)
1629 .TP
1630 .B time_starttransfer
1631 The time, in seconds, it took from the start until the first byte was just
1632 about to be transferred. This includes time_pretransfer and also the time the
1633 server needed to calculate the result.
1634 .TP
1635 .B time_total
1636 The total time, in seconds, that the full operation lasted. The time will be
1637 displayed with millisecond resolution.
1638 .TP
1639 .B url_effective
1640 The URL that was fetched last. This is most meaningful if you've told curl
1641 to follow location: headers.
1642 .RE
1643
1644 If this option is used several times, the last one will be used.
1645 .IP "-x, --proxy <[protocol://][user:password@]proxyhost[:port]>"
1646 Use the specified HTTP proxy. If the port number is not specified, it is
1647 assumed at port 1080.
1648
1649 This option overrides existing environment variables that set the proxy to
1650 use. If there's an environment variable setting a proxy, you can set proxy to
1651 \&"" to override it.
1652
1653 All operations that are performed over an HTTP proxy will transparently be
1654 converted to HTTP. It means that certain protocol specific operations might
1655 not be available. This is not the case if you can tunnel through the proxy, as
1656 one with the \fI-p, --proxytunnel\fP option.
1657
1658 User and password that might be provided in the proxy string are URL decoded
1659 by curl. This allows you to pass in special characters such as @ by using %40
1660 or pass in a colon with %3a.
1661
1662 The proxy host can be specified the exact same way as the proxy environment
1663 variables, including the protocol prefix (http://) and the embedded user +
1664 password.
1665
1666 From 7.21.7, the proxy string may be specified with a protocol:// prefix to
1667 specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or
1668 socks5h:// to request the specific SOCKS version to be used. No protocol
1669 specified, http:// and all others will be treated as HTTP proxies.
1670
1671 If this option is used several times, the last one will be used.
1672 .IP "-X, --request <command>"
1673 (HTTP) Specifies a custom request method to use when communicating with the
1674 HTTP server.  The specified request will be used instead of the method
1675 otherwise used (which defaults to GET). Read the HTTP 1.1 specification for
1676 details and explanations. Common additional HTTP requests include PUT and
1677 DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
1678 more.
1679
1680 Normally you don't need this option. All sorts of GET, HEAD, POST and PUT
1681 requests are rather invoked by using dedicated command line options.
1682
1683 This option only changes the actual word used in the HTTP request, it does not
1684 alter the way curl behaves. So for example if you want to make a proper HEAD
1685 request, using -X HEAD will not suffice. You need to use the \fI-I, --head\fP
1686 option.
1687
1688 (FTP)
1689 Specifies a custom FTP command to use instead of LIST when doing file lists
1690 with FTP.
1691
1692 If this option is used several times, the last one will be used.
1693
1694 .IP "--xattr"
1695 When saving output to a file, this option tells curl to store certain file
1696 metadata in extended file attributes. Currently, the URL is stored in the
1697 xdg.origin.url attribute and, for HTTP, the content type is stored in
1698 the mime_type attribute. If the file system does not support extended
1699 attributes, a warning is issued.
1700
1701 .IP "-y, --speed-time <time>"
1702 If a download is slower than speed-limit bytes per second during a speed-time
1703 period, the download gets aborted. If speed-time is used, the default
1704 speed-limit will be 1 unless set with \fI-Y\fP.
1705
1706 This option controls transfers and thus will not affect slow connects etc. If
1707 this is a concern for you, try the \fI--connect-timeout\fP option.
1708
1709 If this option is used several times, the last one will be used.
1710 .IP "-Y, --speed-limit <speed>"
1711 If a download is slower than this given speed (in bytes per second) for
1712 speed-time seconds it gets aborted. speed-time is set with \fI-y\fP and is 30
1713 if not set.
1714
1715 If this option is used several times, the last one will be used.
1716 .IP "-z, --time-cond <date expression>|<file>"
1717 (HTTP/FTP) Request a file that has been modified later than the given time and
1718 date, or one that has been modified before that time. The <date expression>
1719 can be all sorts of date strings or if it doesn't match any internal ones, it
1720 is taken as a filename and tries to get the modification date (mtime) from
1721 <file> instead. See the \fIcurl_getdate(3)\fP man pages for date expression
1722 details.
1723
1724 Start the date expression with a dash (-) to make it request for a document
1725 that is older than the given date/time, default is a document that is newer
1726 than the specified date/time.
1727
1728 If this option is used several times, the last one will be used.
1729 .IP "-h, --help"
1730 Usage help.
1731 .IP "-M, --manual"
1732 Manual. Display the huge help text.
1733 .IP "-V, --version"
1734 Displays information about curl and the libcurl version it uses.
1735
1736 The first line includes the full version of curl, libcurl and other 3rd party
1737 libraries linked with the executable.
1738
1739 The second line (starts with "Protocols:") shows all protocols that libcurl
1740 reports to support.
1741
1742 The third line (starts with "Features:") shows specific features libcurl
1743 reports to offer. Available features include:
1744 .RS
1745 .IP "IPv6"
1746 You can use IPv6 with this.
1747 .IP "krb4"
1748 Krb4 for FTP is supported.
1749 .IP "SSL"
1750 HTTPS and FTPS are supported.
1751 .IP "libz"
1752 Automatic decompression of compressed files over HTTP is supported.
1753 .IP "NTLM"
1754 NTLM authentication is supported.
1755 .IP "GSS-Negotiate"
1756 Negotiate authentication and krb5 for FTP is supported.
1757 .IP "Debug"
1758 This curl uses a libcurl built with Debug. This enables more error-tracking
1759 and memory debugging etc. For curl-developers only!
1760 .IP "AsynchDNS"
1761 This curl uses asynchronous name resolves.
1762 .IP "SPNEGO"
1763 SPNEGO Negotiate authentication is supported.
1764 .IP "Largefile"
1765 This curl supports transfers of large files, files larger than 2GB.
1766 .IP "IDN"
1767 This curl supports IDN - international domain names.
1768 .IP "SSPI"
1769 SSPI is supported. If you use NTLM and set a blank user name, curl will
1770 authenticate with your current user and password.
1771 .IP "TLS-SRP"
1772 SRP (Secure Remote Password) authentication is supported for TLS.
1773 .IP "Metalink"
1774 This curl supports Metalink (both version 3 and 4 (RFC 5854)), which
1775 describes mirrors and hashes.  curl will use mirrors for failover if
1776 there are errors (such as the file or server not being available).
1777 .RE
1778 .SH FILES
1779 .I ~/.curlrc
1780 .RS
1781 Default config file, see \fI-K, --config\fP for details.
1782 .SH ENVIRONMENT
1783 The environment variables can be specified in lower case or upper case. The
1784 lower case version has precedence. http_proxy is an exception as it is only
1785 available in lower case.
1786
1787 Using an environment variable to set the proxy has the same effect as using
1788 the \fI--proxy\fP option.
1789
1790 .IP "http_proxy [protocol://]<host>[:port]"
1791 Sets the proxy server to use for HTTP.
1792 .IP "HTTPS_PROXY [protocol://]<host>[:port]"
1793 Sets the proxy server to use for HTTPS.
1794 .IP "[url-protocol]_PROXY [protocol://]<host>[:port]"
1795 Sets the proxy server to use for [url-protocol], where the protocol is a
1796 protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP,
1797 SMTP, LDAP etc.
1798 .IP "ALL_PROXY [protocol://]<host>[:port]"
1799 Sets the proxy server to use if no protocol-specific proxy is set.
1800 .IP "NO_PROXY <comma-separated list of hosts>"
1801 list of host names that shouldn't go through any proxy. If set to a asterisk
1802 \&'*' only, it matches all hosts.
1803 .SH "PROXY PROTOCOL PREFIXES"
1804 Since curl version 7.21.7, the proxy string may be specified with a
1805 protocol:// prefix to specify alternative proxy protocols.
1806
1807 If no protocol is specified in the proxy string or if the string doesn't match
1808 a supported one, the proxy will be treated as an HTTP proxy.
1809
1810 The supported proxy protocol prefixes are as follows:
1811 .IP "socks4://"
1812 Makes it the equivalent of \fI--socks4\fP
1813 .IP "socks4a://"
1814 Makes it the equivalent of \fI--socks4a\fP
1815 .IP "socks5://"
1816 Makes it the equivalent of \fI--socks5\fP
1817 .IP "socks5h://"
1818 Makes it the equivalent of \fI--socks5-hostname\fP
1819 .SH EXIT CODES
1820 There are a bunch of different error codes and their corresponding error
1821 messages that may appear during bad conditions. At the time of this writing,
1822 the exit codes are:
1823 .IP 1
1824 Unsupported protocol. This build of curl has no support for this protocol.
1825 .IP 2
1826 Failed to initialize.
1827 .IP 3
1828 URL malformed. The syntax was not correct.
1829 .IP 4
1830 A feature or option that was needed to perform the desired request was not
1831 enabled or was explicitly disabled at build-time. To make curl able to do
1832 this, you probably need another build of libcurl!
1833 .IP 5
1834 Couldn't resolve proxy. The given proxy host could not be resolved.
1835 .IP 6
1836 Couldn't resolve host. The given remote host was not resolved.
1837 .IP 7
1838 Failed to connect to host.
1839 .IP 8
1840 FTP weird server reply. The server sent data curl couldn't parse.
1841 .IP 9
1842 FTP access denied. The server denied login or denied access to the particular
1843 resource or directory you wanted to reach. Most often you tried to change to a
1844 directory that doesn't exist on the server.
1845 .IP 11
1846 FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request.
1847 .IP 13
1848 FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request.
1849 .IP 14
1850 FTP weird 227 format. Curl couldn't parse the 227-line the server sent.
1851 .IP 15
1852 FTP can't get host. Couldn't resolve the host IP we got in the 227-line.
1853 .IP 17
1854 FTP couldn't set binary. Couldn't change transfer method to binary.
1855 .IP 18
1856 Partial file. Only a part of the file was transferred.
1857 .IP 19
1858 FTP couldn't download/access the given file, the RETR (or similar) command
1859 failed.
1860 .IP 21
1861 FTP quote error. A quote command returned error from the server.
1862 .IP 22
1863 HTTP page not retrieved. The requested url was not found or returned another
1864 error with the HTTP error code being 400 or above. This return code only
1865 appears if \fI-f, --fail\fP is used.
1866 .IP 23
1867 Write error. Curl couldn't write data to a local filesystem or similar.
1868 .IP 25
1869 FTP couldn't STOR file. The server denied the STOR operation, used for FTP
1870 uploading.
1871 .IP 26
1872 Read error. Various reading problems.
1873 .IP 27
1874 Out of memory. A memory allocation request failed.
1875 .IP 28
1876 Operation timeout. The specified time-out period was reached according to the
1877 conditions.
1878 .IP 30
1879 FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT
1880 command, try doing a transfer using PASV instead!
1881 .IP 31
1882 FTP couldn't use REST. The REST command failed. This command is used for
1883 resumed FTP transfers.
1884 .IP 33
1885 HTTP range error. The range "command" didn't work.
1886 .IP 34
1887 HTTP post error. Internal post-request generation error.
1888 .IP 35
1889 SSL connect error. The SSL handshaking failed.
1890 .IP 36
1891 FTP bad download resume. Couldn't continue an earlier aborted download.
1892 .IP 37
1893 FILE couldn't read file. Failed to open the file. Permissions?
1894 .IP 38
1895 LDAP cannot bind. LDAP bind operation failed.
1896 .IP 39
1897 LDAP search failed.
1898 .IP 41
1899 Function not found. A required LDAP function was not found.
1900 .IP 42
1901 Aborted by callback. An application told curl to abort the operation.
1902 .IP 43
1903 Internal error. A function was called with a bad parameter.
1904 .IP 45
1905 Interface error. A specified outgoing interface could not be used.
1906 .IP 47
1907 Too many redirects. When following redirects, curl hit the maximum amount.
1908 .IP 48
1909 Unknown option specified to libcurl. This indicates that you passed a weird
1910 option to curl that was passed on to libcurl and rejected. Read up in the
1911 manual!
1912 .IP 49
1913 Malformed telnet option.
1914 .IP 51
1915 The peer's SSL certificate or SSH MD5 fingerprint was not OK.
1916 .IP 52
1917 The server didn't reply anything, which here is considered an error.
1918 .IP 53
1919 SSL crypto engine not found.
1920 .IP 54
1921 Cannot set SSL crypto engine as default.
1922 .IP 55
1923 Failed sending network data.
1924 .IP 56
1925 Failure in receiving network data.
1926 .IP 58
1927 Problem with the local certificate.
1928 .IP 59
1929 Couldn't use specified SSL cipher.
1930 .IP 60
1931 Peer certificate cannot be authenticated with known CA certificates.
1932 .IP 61
1933 Unrecognized transfer encoding.
1934 .IP 62
1935 Invalid LDAP URL.
1936 .IP 63
1937 Maximum file size exceeded.
1938 .IP 64
1939 Requested FTP SSL level failed.
1940 .IP 65
1941 Sending the data requires a rewind that failed.
1942 .IP 66
1943 Failed to initialise SSL Engine.
1944 .IP 67
1945 The user name, password, or similar was not accepted and curl failed to log in.
1946 .IP 68
1947 File not found on TFTP server.
1948 .IP 69
1949 Permission problem on TFTP server.
1950 .IP 70
1951 Out of disk space on TFTP server.
1952 .IP 71
1953 Illegal TFTP operation.
1954 .IP 72
1955 Unknown TFTP transfer ID.
1956 .IP 73
1957 File already exists (TFTP).
1958 .IP 74
1959 No such user (TFTP).
1960 .IP 75
1961 Character conversion failed.
1962 .IP 76
1963 Character conversion functions required.
1964 .IP 77
1965 Problem with reading the SSL CA cert (path? access rights?).
1966 .IP 78
1967 The resource referenced in the URL does not exist.
1968 .IP 79
1969 An unspecified error occurred during the SSH session.
1970 .IP 80
1971 Failed to shut down the SSL connection.
1972 .IP 82
1973 Could not load CRL file, missing or wrong format (added in 7.19.0).
1974 .IP 83
1975 Issuer check failed (added in 7.19.0).
1976 .IP 84
1977 The FTP PRET command failed
1978 .IP 85
1979 RTSP: mismatch of CSeq numbers
1980 .IP 86
1981 RTSP: mismatch of Session Identifiers
1982 .IP 87
1983 unable to parse FTP file list
1984 .IP 88
1985 FTP chunk callback reported error
1986 .IP XX
1987 More error codes will appear here in future releases. The existing ones
1988 are meant to never change.
1989 .SH AUTHORS / CONTRIBUTORS
1990 Daniel Stenberg is the main author, but the whole list of contributors is
1991 found in the separate THANKS file.
1992 .SH WWW
1993 http://curl.haxx.se
1994 .SH FTP
1995 ftp://ftp.sunet.se/pub/www/utilities/curl/
1996 .SH "SEE ALSO"
1997 .BR ftp (1),
1998 .BR wget (1)