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