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