1curl(1) Curl Manual curl(1)
2
3
4
6 curl - transfer a URL
7
9 curl [options] [URL...]
10
12 curl is a tool to transfer data from or to a server, using one of the
13 supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT,
14 TELNET, LDAP or FILE). The command is designed to work without user
15 interaction.
16
17 curl offers a busload of useful tricks like proxy support, user authen‐
18 tication, ftp upload, HTTP post, SSL connections, cookies, file trans‐
19 fer resume and more. As you will see below, the amount of features will
20 make your head spin!
21
22 curl is powered by libcurl for all transfer-related features. See
23 libcurl(3) for details.
24
26 The URL syntax is protocol dependent. You'll find a detailed descrip‐
27 tion in RFC 3986.
28
29 You can specify multiple URLs or parts of URLs by writing part sets
30 within braces as in:
31
32 http://site.{one,two,three}.com
33
34 or you can get sequences of alphanumeric series by using [] as in:
35
36 ftp://ftp.numericals.com/file[1-100].txt
37 ftp://ftp.numericals.com/file[001-100].txt (with leading zeros)
38 ftp://ftp.letters.com/file[a-z].txt
39
40 No nesting of the sequences is supported at the moment, but you can use
41 several ones next to each other:
42
43 http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html
44
45 You can specify any amount of URLs on the command line. They will be
46 fetched in a sequential manner in the specified order.
47
48 Since curl 7.15.1 you can also specify step counter for the ranges, so
49 that you can get every Nth number or letter:
50
51 http://www.numericals.com/file[1-100:10].txt
52 http://www.letters.com/file[a-z:2].txt
53
54 If you specify URL without protocol:// prefix, curl will attempt to
55 guess what protocol you might want. It will then default to HTTP but
56 try other protocols based on often-used host name prefixes. For exam‐
57 ple, for host names starting with "ftp." curl will assume you want to
58 speak FTP.
59
60 Curl will attempt to re-use connections for multiple file transfers, so
61 that getting many files from the same server will not do multiple con‐
62 nects / handshakes. This improves speed. Of course this is only done on
63 files specified on a single command line and cannot be used between
64 separate curl invokes.
65
67 curl normally displays a progress meter during operations, indicating
68 amount of transfered data, transfer speeds and estimated time left etc.
69
70 However, since curl displays data to the terminal by default, if you
71 invoke curl to do an operation and it is about to write data to the
72 terminal, it disables the progress meter as otherwise it would mess up
73 the output mixing progress meter and response data.
74
75 If you want a progress meter for HTTP POST or PUT requests, you need to
76 redirect the response output to a file, using shell redirect (>), -o
77 [file] or similar.
78
79 It is not the same case for FTP upload as that operation is not spit‐
80 ting out any response data to the terminal.
81
82 If you prefer a progress "bar" instead of the regular meter, -# is your
83 friend.
84
86 -a/--append
87 (FTP) When used in an FTP upload, this will tell curl to append
88 to the target file instead of overwriting it. If the file
89 doesn't exist, it will be created.
90
91 If this option is used twice, the second one will disable append
92 mode again.
93
94 -A/--user-agent <agent string>
95 (HTTP) Specify the User-Agent string to send to the HTTP server.
96 Some badly done CGIs fail if its not set to "Mozilla/4.0". To
97 encode blanks in the string, surround the string with single
98 quote marks. This can also be set with the -H/--header option
99 of course.
100
101 If this option is set more than once, the last one will be the
102 one that's used.
103
104 --anyauth
105 (HTTP) Tells curl to figure out authentication method by itself,
106 and use the most secure one the remote site claims it supports.
107 This is done by first doing a request and checking the response-
108 headers, thus inducing an extra network round-trip. This is used
109 instead of setting a specific authentication method, which you
110 can do with --basic, --digest, --ntlm, and --negotiate.
111
112 Note that using --anyauth is not recommended if you do uploads
113 from stdin, since it may require data to be sent twice and then
114 the client must be able to rewind. If the need should arise when
115 uploading from stdin, the upload operation will fail.
116
117 If this option is used several times, the following occurrences
118 make no difference.
119
120 -b/--cookie <name=data>
121 (HTTP) Pass the data to the HTTP server as a cookie. It is sup‐
122 posedly the data previously received from the server in a "Set-
123 Cookie:" line. The data should be in the format "NAME1=VALUE1;
124 NAME2=VALUE2".
125
126 If no '=' letter is used in the line, it is treated as a file‐
127 name to use to read previously stored cookie lines from, which
128 should be used in this session if they match. Using this method
129 also activates the "cookie parser" which will make curl record
130 incoming cookies too, which may be handy if you're using this in
131 combination with the -L/--location option. The file format of
132 the file to read cookies from should be plain HTTP headers or
133 the Netscape/Mozilla cookie file format.
134
135 NOTE that the file specified with -b/--cookie is only used as
136 input. No cookies will be stored in the file. To store cookies,
137 use the -c/--cookie-jar option or you could even save the HTTP
138 headers to a file using -D/--dump-header!
139
140 If this option is set more than once, the last one will be the
141 one that's used.
142
143 -B/--use-ascii
144 Enable ASCII transfer when using FTP or LDAP. For FTP, this can
145 also be enforced by using an URL that ends with ";type=A". This
146 option causes data sent to stdout to be in text mode for win32
147 systems.
148
149 If this option is used twice, the second one will disable ASCII
150 usage.
151
152 --basic
153 (HTTP) Tells curl to use HTTP Basic authentication. This is the
154 default and this option is usually pointless, unless you use it
155 to override a previously set option that sets a different
156 authentication method (such as --ntlm, --digest and --negoti‐
157 ate).
158
159 If this option is used several times, the following occurrences
160 make no difference.
161
162 --ciphers <list of ciphers>
163 (SSL) Specifies which ciphers to use in the connection. The list
164 of ciphers must be using valid ciphers. Read up on SSL cipher
165 list details on this URL:
166 http://www.openssl.org/docs/apps/ciphers.html
167
168 NSS ciphers are done differently than OpenSSL and GnuTLS. The
169 full list of NSS ciphers is in the NSSCipherSuite entry at this
170 URL: http://directory.fedora.redhat.com/docs/mod_nss.html#Direc‐
171 tives
172
173 If this option is used several times, the last one will override
174 the others.
175
176 --compressed
177 (HTTP) Request a compressed response using one of the algorithms
178 libcurl supports, and return the uncompressed document. If this
179 option is used and the server sends an unsupported encoding,
180 Curl will report an error.
181
182 If this option is used several times, each occurrence will tog‐
183 gle it on/off.
184
185 --connect-timeout <seconds>
186 Maximum time in seconds that you allow the connection to the
187 server to take. This only limits the connection phase, once
188 curl has connected this option is of no more use. See also the
189 -m/--max-time option.
190
191 If this option is used several times, the last one will be used.
192
193 -c/--cookie-jar <file name>
194 Specify to which file you want curl to write all cookies after a
195 completed operation. Curl writes all cookies previously read
196 from a specified file as well as all cookies received from
197 remote server(s). If no cookies are known, no file will be writ‐
198 ten. The file will be written using the Netscape cookie file
199 format. If you set the file name to a single dash, "-", the
200 cookies will be written to stdout.
201
202 NOTE If the cookie jar can't be created or written to, the whole
203 curl operation won't fail or even report an error clearly. Using
204 -v will get a warning displayed, but that is the only visible
205 feedback you get about this possibly lethal situation.
206
207 If this option is used several times, the last specified file
208 name will be used.
209
210 -C/--continue-at <offset>
211 Continue/Resume a previous file transfer at the given offset.
212 The given offset is the exact number of bytes that will be
213 skipped counted from the beginning of the source file before it
214 is transferred to the destination. If used with uploads, the
215 ftp server command SIZE will not be used by curl.
216
217 Use "-C -" to tell curl to automatically find out where/how to
218 resume the transfer. It then uses the given output/input files
219 to figure that out.
220
221 If this option is used several times, the last one will be used.
222
223 --create-dirs
224 When used in conjunction with the -o option, curl will create
225 the necessary local directory hierarchy as needed. This option
226 creates the dirs mentioned with the -o option, nothing else. If
227 the -o file name uses no dir or if the dirs it mentions already
228 exist, no dir will be created.
229
230 To create remote directories when using FTP or SFTP, try --ftp-
231 create-dirs.
232
233 --crlf (FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
234
235 If this option is used several times, the following occurrences
236 make no difference.
237
238 -d/--data <data>
239 (HTTP) Sends the specified data in a POST request to the HTTP
240 server, in a way that can emulate as if a user has filled in a
241 HTML form and pressed the submit button. Note that the data is
242 sent exactly as specified with no extra processing (with all
243 newlines cut off). The data is expected to be "url-encoded".
244 This will cause curl to pass the data to the server using the
245 content-type application/x-www-form-urlencoded. Compare to
246 -F/--form. If this option is used more than once on the same
247 command line, the data pieces specified will be merged together
248 with a separating &-letter. Thus, using '-d name=daniel -d
249 skill=lousy' would generate a post chunk that looks like
250 'name=daniel&skill=lousy'.
251
252 If you start the data with the letter @, the rest should be a
253 file name to read the data from, or - if you want curl to read
254 the data from stdin. The contents of the file must already be
255 url-encoded. Multiple files can also be specified. Posting data
256 from a file named 'foobar' would thus be done with --data @foo‐
257 bar".
258
259 To post data purely binary, you should instead use the --data-
260 binary option.
261
262 -d/--data is the same as --data-ascii.
263
264 If this option is used several times, the ones following the
265 first will append data.
266
267 --data-ascii <data>
268 (HTTP) This is an alias for the -d/--data option.
269
270 If this option is used several times, the ones following the
271 first will append data.
272
273 --data-binary <data>
274 (HTTP) This posts data in a similar manner as --data-ascii does,
275 although when using this option the entire context of the posted
276 data is kept as-is. If you want to post a binary file without
277 the strip-newlines feature of the --data-ascii option, this is
278 for you.
279
280 If this option is used several times, the ones following the
281 first will append data.
282
283 --digest
284 (HTTP) Enables HTTP Digest authentication. This is a authentica‐
285 tion that prevents the password from being sent over the wire in
286 clear text. Use this in combination with the normal -u/--user
287 option to set user name and password. See also --ntlm, --negoti‐
288 ate and --anyauth for related options.
289
290 If this option is used several times, the following occurrences
291 make no difference.
292
293 --disable-eprt
294 (FTP) Tell curl to disable the use of the EPRT and LPRT commands
295 when doing active FTP transfers. Curl will normally always first
296 attempt to use EPRT, then LPRT before using PORT, but with this
297 option, it will use PORT right away. EPRT and LPRT are exten‐
298 sions to the original FTP protocol, may not work on all servers
299 but enable more functionality in a better way than the tradi‐
300 tional PORT command.
301
302 If this option is used several times, each occurrence will tog‐
303 gle this on/off.
304
305 --disable-epsv
306 (FTP) Tell curl to disable the use of the EPSV command when
307 doing passive FTP transfers. Curl will normally always first
308 attempt to use EPSV before PASV, but with this option, it will
309 not try using EPSV.
310
311 If this option is used several times, each occurrence will tog‐
312 gle this on/off.
313
314 -D/--dump-header <file>
315 Write the protocol headers to the specified file.
316
317 This option is handy to use when you want to store the headers
318 that a HTTP site sends to you. Cookies from the headers could
319 then be read in a second curl invoke by using the -b/--cookie
320 option! The -c/--cookie-jar option is however a better way to
321 store cookies.
322
323 When used on FTP, the ftp server response lines are considered
324 being "headers" and thus are saved there.
325
326 If this option is used several times, the last one will be used.
327
328 -e/--referer <URL>
329 (HTTP) Sends the "Referer Page" information to the HTTP server.
330 This can also be set with the -H/--header flag of course. When
331 used with -L/--location you can append ";auto" to the --referer
332 URL to make curl automatically set the previous URL when it fol‐
333 lows a Location: header. The ";auto" string can be used alone,
334 even if you don't set an initial --referer.
335
336 If this option is used several times, the last one will be used.
337
338 --engine <name>
339 Select the OpenSSL crypto engine to use for cipher operations.
340 Use --engine list to print a list of build-time supported
341 engines. Note that not all (or none) of the engines may be
342 available at run-time.
343
344 --environment
345 (RISC OS ONLY) Sets a range of environment variables, using the
346 names the -w option supports, to easier allow extraction of use‐
347 ful information after having run curl.
348
349 If this option is used several times, each occurrence will tog‐
350 gle this on/off.
351
352 --egd-file <file>
353 (SSL) Specify the path name to the Entropy Gathering Daemon
354 socket. The socket is used to seed the random engine for SSL
355 connections. See also the --random-file option.
356
357 -E/--cert <certificate[:password]>
358 (SSL) Tells curl to use the specified certificate file when get‐
359 ting a file with HTTPS or FTPS. The certificate must be in PEM
360 format. If the optional password isn't specified, it will be
361 queried for on the terminal. Note that this option assumes a
362 "certificate" file that is the private key and the private cer‐
363 tificate concatenated! See --cert and --key to specify them
364 independently.
365
366 If curl is built against the NSS SSL library then this option
367 tells curl the nickname of the certificate to use within the NSS
368 database defined by --cacert.
369
370 If this option is used several times, the last one will be used.
371
372 --cert-type <type>
373 (SSL) Tells curl what certificate type the provided certificate
374 is in. PEM, DER and ENG are recognized types. If not specified,
375 PEM is assumed.
376
377 If this option is used several times, the last one will be used.
378
379 --cacert <CA certificate>
380 (SSL) Tells curl to use the specified certificate file to verify
381 the peer. The file may contain multiple CA certificates. The
382 certificate(s) must be in PEM format.
383
384 curl recognizes the environment variable named 'CURL_CA_BUNDLE'
385 if that is set, and uses the given path as a path to a CA cert
386 bundle. This option overrides that variable.
387
388 The windows version of curl will automatically look for a CA
389 certs file named ´curl-ca-bundle.crt´, either in the same direc‐
390 tory as curl.exe, or in the Current Working Directory, or in any
391 folder along your PATH.
392
393 If curl is built against the NSS SSL library then this option
394 tells curl the directory that the NSS certificate database
395 resides in.
396
397 If this option is used several times, the last one will be used.
398
399 --capath <CA certificate directory>
400 (SSL) Tells curl to use the specified certificate directory to
401 verify the peer. The certificates must be in PEM format, and the
402 directory must have been processed using the c_rehash utility
403 supplied with openssl. Using --capath can allow curl to make
404 SSL-connections much more efficiently than using --cacert if the
405 --cacert file contains many CA certificates.
406
407 If this option is used several times, the last one will be used.
408
409 -f/--fail
410 (HTTP) Fail silently (no output at all) on server errors. This
411 is mostly done like this to better enable scripts etc to better
412 deal with failed attempts. In normal cases when a HTTP server
413 fails to deliver a document, it returns an HTML document stating
414 so (which often also describes why and more). This flag will
415 prevent curl from outputting that and return error 22.
416
417 This method is not fail-safe and there are occasions where non-
418 successful response codes will slip through, especially when
419 authentication is involved (response codes 401 and 407).
420
421 If this option is used twice, the second will again disable
422 silent failure.
423
424 --ftp-account [data]
425 (FTP) When an FTP server asks for "account data" after user name
426 and password has been provided, this data is sent off using the
427 ACCT command. (Added in 7.13.0)
428
429 If this option is used twice, the second will override the pre‐
430 vious use.
431
432 --ftp-create-dirs
433 (FTP) When an FTP or SFTP URL/operation uses a path that doesn't
434 currently exist on the server, the standard behavior of curl is
435 to fail. Using this option, curl will instead attempt to create
436 missing directories.
437
438 If this option is used twice, the second will again disable
439 directory creation.
440
441 --ftp-method [method]
442 (FTP) Control what method curl should use to reach a file on a
443 FTP(S) server. The method argument should be one of the follow‐
444 ing alternatives:
445
446 multicwd
447 curl does a single CWD operation for each path part in
448 the given URL. For deep hierarchies this means very many
449 commands. This is how RFC1738 says it should be done.
450 This is the default but the slowest behavior.
451
452 nocwd curl does no CWD at all. curl will do SIZE, RETR, STOR
453 etc and give a full path to the server for all these com‐
454 mands. This is the fastest behavior.
455
456 singlecwd
457 curl does one CWD with the full target directory and then
458 operates on the file "normally" (like in the multicwd
459 case). This is somewhat more standards compliant than
460 'nocwd' but without the full penalty of 'multicwd'.
461
462 --ftp-pasv
463 (FTP) Use PASV when transferring. PASV is the internal default
464 behavior, but using this option can be used to override a previ‐
465 ous --ftp-port option. (Added in 7.11.0)
466
467 If this option is used several times, the following occurrences
468 make no difference.
469
470 --ftp-alternative-to-user <command>
471 (FTP) If authenticating with the USER and PASS commands fails,
472 send this command. When connecting to Tumbleweed's Secure
473 Transport server over FTPS using a client certificate, using
474 "SITE AUTH" will tell the server to retrieve the username from
475 the certificate. (Added in 7.15.5)
476
477 --ftp-skip-pasv-ip
478 (FTP) Tell curl to not use the IP address the server suggests in
479 its response to curl's PASV command when curl connects the data
480 connection. Instead curl will re-use the same IP address it
481 already uses for the control connection. (Added in 7.14.2)
482
483 This option has no effect if PORT, EPRT or EPSV is used instead
484 of PASV.
485
486 If this option is used twice, the second will again use the
487 server's suggested address.
488
489 --ftp-ssl
490 (FTP) Try to use SSL/TLS for the FTP connection. Reverts to a
491 non-secure connection if the server doesn't support SSL/TLS.
492 See also --ftp-ssl-control and --ftp-ssl-reqd for different lev‐
493 els of encryption required. (Added in 7.11.0)
494
495 If this option is used twice, the second will again disable
496 this.
497
498 --ftp-ssl-control
499 (FTP) Require SSL/TLS for the ftp login, clear for transfer.
500 Allows secure authentication, but non-encrypted data transfers
501 for efficiency. Fails the transfer if the server doesn't sup‐
502 port SSL/TLS. (Added in 7.16.0)
503
504 If this option is used twice, the second will again disable
505 this.
506
507 --ftp-ssl-reqd
508 (FTP) Require SSL/TLS for the FTP connection. Terminates the
509 connection if the server doesn't support SSL/TLS. (Added in
510 7.15.5)
511
512 If this option is used twice, the second will again disable
513 this.
514
515 --ftp-ssl-ccc
516 (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS
517 layer after authenticating. The rest of the control channel com‐
518 munication will be unencrypted. This allows NAT routers to fol‐
519 low the FTP transaction. The default mode is passive. See --ftp-
520 ssl-ccc-mode for other modes. (Added in 7.16.1)
521
522 If this option is used twice, the second will again disable
523 this.
524
525 --ftp-ssl-ccc-mode [active/passive]
526 (FTP) Use CCC (Clear Command Channel) Sets the CCC mode. The
527 passive mode will not initiate the shutdown, but instead wait
528 for the server to do it, and will not reply to the shutdown from
529 the server. The active mode initiates the shutdown and waits for
530 a reply from the server. (Added in 7.16.2)
531
532 -F/--form <name=content>
533 (HTTP) This lets curl emulate a filled in form in which a user
534 has pressed the submit button. This causes curl to POST data
535 using the Content-Type multipart/form-data according to RFC1867.
536 This enables uploading of binary files etc. To force the 'con‐
537 tent' part to be a file, prefix the file name with an @ sign. To
538 just get the content part from a file, prefix the file name with
539 the letter <. The difference between @ and < is then that @
540 makes a file get attached in the post as a file upload, while
541 the < makes a text field and just get the contents for that text
542 field from a file.
543
544 Example, to send your password file to the server, where 'pass‐
545 word' is the name of the form-field to which /etc/passwd will be
546 the input:
547
548 curl -F password=@/etc/passwd www.mypasswords.com
549
550 To read the file's content from stdin instead of a file, use -
551 where the file name should've been. This goes for both @ and <
552 constructs.
553
554 You can also tell curl what Content-Type to use by using
555 'type=', in a manner similar to:
556
557 curl -F "web=@index.html;type=text/html" url.com
558
559 or
560
561 curl -F "name=daniel;type=text/foo" url.com
562
563 You can also explicitly change the name field of an file upload
564 part by setting filename=, like this:
565
566 curl -F "file=@localfile;filename=nameinpost" url.com
567
568 See further examples and details in the MANUAL.
569
570 This option can be used multiple times.
571
572 --form-string <name=string>
573 (HTTP) Similar to --form except that the value string for the
574 named parameter is used literally. Leading '@' and '<' charac‐
575 ters, and the ';type=' string in the value have no special mean‐
576 ing. Use this in preference to --form if there's any possibility
577 that the string value may accidentally trigger the '@' or '<'
578 features of --form.
579
580 -g/--globoff
581 This option switches off the "URL globbing parser". When you set
582 this option, you can specify URLs that contain the letters {}[]
583 without having them being interpreted by curl itself. Note that
584 these letters are not normal legal URL contents but they should
585 be encoded according to the URI standard.
586
587 -G/--get
588 When used, this option will make all data specified with
589 -d/--data or --data-binary to be used in a HTTP GET request
590 instead of the POST request that otherwise would be used. The
591 data will be appended to the URL with a '?' separator.
592
593 If used in combination with -I, the POST data will instead be
594 appended to the URL with a HEAD request.
595
596 If this option is used several times, the following occurrences
597 make no difference.
598
599 -h/--help
600 Usage help.
601
602 -H/--header <header>
603 (HTTP) Extra header to use when getting a web page. You may
604 specify any number of extra headers. Note that if you should add
605 a custom header that has the same name as one of the internal
606 ones curl would use, your externally set header will be used
607 instead of the internal one. This allows you to make even trick‐
608 ier stuff than curl would normally do. You should not replace
609 internally set headers without knowing perfectly well what
610 you're doing. Remove an internal header by giving a replacement
611 without content on the right side of the colon, as in: -H
612 "Host:".
613
614 curl will make sure that each header you add/replace get sent
615 with the proper end of line marker, you should thus not add that
616 as a part of the header content: do not add newlines or carriage
617 returns they will only mess things up for you.
618
619 See also the -A/--user-agent and -e/--referer options.
620
621 This option can be used multiple times to add/replace/remove
622 multiple headers.
623
624 --ignore-content-length
625 (HTTP) Ignore the Content-Length header. This is particularly
626 useful for servers running Apache 1.x, which will report incor‐
627 rect Content-Length for files larger than 2 gigabytes.
628
629 -i/--include
630 (HTTP) Include the HTTP-header in the output. The HTTP-header
631 includes things like server-name, date of the document, HTTP-
632 version and more...
633
634 If this option is used twice, the second will again disable
635 header include.
636
637 --interface <name>
638 Perform an operation using a specified interface. You can enter
639 interface name, IP address or host name. An example could look
640 like:
641
642 curl --interface eth0:1 http://www.netscape.com/
643
644 If this option is used several times, the last one will be used.
645
646 -I/--head
647 (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature
648 the command HEAD which this uses to get nothing but the header
649 of a document. When used on a FTP or FILE file, curl displays
650 the file size and last modification time only.
651
652 If this option is used twice, the second will again disable
653 header only.
654
655 -j/--junk-session-cookies
656 (HTTP) When curl is told to read cookies from a given file, this
657 option will make it discard all "session cookies". This will
658 basically have the same effect as if a new session is started.
659 Typical browsers always discard session cookies when they're
660 closed down.
661
662 If this option is used several times, each occurrence will tog‐
663 gle this on/off.
664
665 -k/--insecure
666 (SSL) This option explicitly allows curl to perform "insecure"
667 SSL connections and transfers. All SSL connections are attempted
668 to be made secure by using the CA certificate bundle installed
669 by default. This makes all connections considered "insecure" to
670 fail unless -k/--insecure is used.
671
672 See this online resource for further details:
673 http://curl.haxx.se/docs/sslcerts.html
674
675 If this option is used twice, the second time will again disable
676 it.
677
678 --key <key>
679 (SSL/SSH) Private key file name. Allows you to provide your pri‐
680 vate key in this separate file.
681
682 If this option is used several times, the last one will be used.
683
684 --key-type <type>
685 (SSL) Private key file type. Specify which type your --key pro‐
686 vided private key is. DER, PEM and ENG are supported. If not
687 specified, PEM is assumed.
688
689 If this option is used several times, the last one will be used.
690
691 --krb <level>
692 (FTP) Enable Kerberos authentication and use. The level must be
693 entered and should be one of 'clear', 'safe', 'confidential' or
694 'private'. Should you use a level that is not one of these,
695 'private' will instead be used.
696
697 This option requires that the library was built with kerberos4
698 or GSSAPI (GSS-Negotiate) support. This is not very common. Use
699 -V/--version to see if your curl supports it.
700
701 If this option is used several times, the last one will be used.
702
703 -K/--config <config file>
704 Specify which config file to read curl arguments from. The con‐
705 fig file is a text file in which command line arguments can be
706 written which then will be used as if they were written on the
707 actual command line. Options and their parameters must be speci‐
708 fied on the same config file line. If the parameter is to con‐
709 tain white spaces, the parameter must be enclosed within quotes.
710 If the first column of a config line is a '#' character, the
711 rest of the line will be treated as a comment. Only write one
712 option per physical line in the config file.
713
714 Specify the filename to -K/--config as '-' to make curl read the
715 file from stdin.
716
717 Note that to be able to specify a URL in the config file, you
718 need to specify it using the --url option, and not by simply
719 writing the URL on its own line. So, it could look similar to
720 this:
721
722 url = "http://curl.haxx.se/docs/"
723
724 Long option names can optionally be given in the config file
725 without the initial double dashes.
726
727 When curl is invoked, it always (unless -q is used) checks for a
728 default config file and uses it if found. The default config
729 file is checked for in the following places in this order:
730
731 1) curl tries to find the "home dir": It first checks for the
732 CURL_HOME and then the HOME environment variables. Failing that,
733 it uses getpwuid() on unix-like systems (which returns the home
734 dir given the current user in your system). On Windows, it then
735 checks for the APPDATA variable, or as a last resort the '%USER‐
736 PROFILE%0lication Data'.
737
738 2) On windows, if there is no _curlrc file in the home dir, it
739 checks for one in the same dir the executable curl is placed. On
740 unix-like systems, it will simply try to load .curlrc from the
741 determined home dir.
742
743 # --- Example file ---
744 # this is a comment
745 url = "curl.haxx.se"
746 output = "curlhere.html"
747 user-agent = "superagent/1.0"
748
749 # and fetch another URL too
750 url = "curl.haxx.se/docs/manpage.html"
751 -O
752 referer = "http://nowhereatall.com/"
753 # --- End of example file ---
754
755 This option can be used multiple times to load multiple config
756 files.
757
758 --libcurl <file>
759 Append this option to any ordinary curl command line, and you
760 will get a libcurl-using source code written to the file that
761 does the equivalent operation of what your command line opera‐
762 tion does!
763
764 If this option is used several times, the last given file name
765 will be used.
766
767 --limit-rate <speed>
768 Specify the maximum transfer rate you want curl to use. This
769 feature is useful if you have a limited pipe and you'd like your
770 transfer not use your entire bandwidth.
771
772 The given speed is measured in bytes/second, unless a suffix is
773 appended. Appending 'k' or 'K' will count the number as kilo‐
774 bytes, 'm' or M' makes it megabytes while 'g' or 'G' makes it
775 gigabytes. Examples: 200K, 3m and 1G.
776
777 The given rate is the average speed, counted during the entire
778 transfer. It means that curl might use higher transfer speeds in
779 short bursts, but over time it uses no more than the given rate.
780
781 If you are also using the -Y/--speed-limit option, that option
782 will take precedence and might cripple the rate-limiting
783 slightly, to help keeping the speed-limit logic working.
784
785 If this option is used several times, the last one will be used.
786
787 -l/--list-only
788 (FTP) When listing an FTP directory, this switch forces a name-
789 only view. Especially useful if you want to machine-parse the
790 contents of an FTP directory since the normal directory view
791 doesn't use a standard look or format.
792
793 This option causes an FTP NLST command to be sent. Some FTP
794 servers list only files in their response to NLST; they do not
795 include subdirectories and symbolic links.
796
797 If this option is used twice, the second will again disable list
798 only.
799
800 --local-port <num>[-num]
801 Set a preferred number or range of local port numbers to use for
802 the connection(s). Note that port numbers by nature is a scarce
803 resource that will be busy at times so setting this range to
804 something too narrow might cause unnecessary connection setup
805 failures. (Added in 7.15.2)
806
807 -L/--location
808 (HTTP/HTTPS) If the server reports that the requested page has
809 moved to a different location (indicated with a Location: header
810 and a 3XX response code) this option will make curl redo the
811 request on the new place. If used together with -i/--include or
812 -I/--head, headers from all requested pages will be shown. When
813 authentication is used, curl only sends its credentials to the
814 initial host. If a redirect takes curl to a different host, it
815 won't be able to intercept the user+password. See also --loca‐
816 tion-trusted on how to change this. You can limit the amount of
817 redirects to follow by using the --max-redirs option.
818
819 When curl follows a redirect and the request is not a plain GET
820 (for example POST or PUT), it will do the following request with
821 a GET if the HTTP response was 301, 302, or 303. If the response
822 code was any other 3xx code, curl will re-send the following
823 request using the same unmodified method.
824
825 If this option is used twice, the second will again disable
826 location following.
827
828 --location-trusted
829 (HTTP/HTTPS) Like -L/--location, but will allow sending the name
830 + password to all hosts that the site may redirect to. This may
831 or may not introduce a security breach if the site redirects you
832 do a site to which you'll send your authentication info (which
833 is plaintext in the case of HTTP Basic authentication).
834
835 If this option is used twice, the second will again disable
836 location following.
837
838 --max-filesize <bytes>
839 Specify the maximum size (in bytes) of a file to download. If
840 the file requested is larger than this value, the transfer will
841 not start and curl will return with exit code 63.
842
843 NOTE: The file size is not always known prior to download, and
844 for such files this option has no effect even if the file trans‐
845 fer ends up being larger than this given limit. This concerns
846 both FTP and HTTP transfers.
847
848 -m/--max-time <seconds>
849 Maximum time in seconds that you allow the whole operation to
850 take. This is useful for preventing your batch jobs from hang‐
851 ing for hours due to slow networks or links going down. See
852 also the --connect-timeout option.
853
854 If this option is used several times, the last one will be used.
855
856 -M/--manual
857 Manual. Display the huge help text.
858
859 -n/--netrc
860 Makes curl scan the .netrc file in the user's home directory for
861 login name and password. This is typically used for ftp on unix.
862 If used with http, curl will enable user authentication. See
863 netrc(4) or ftp(1) for details on the file format. Curl will not
864 complain if that file hasn't the right permissions (it should
865 not be world nor group readable). The environment variable
866 "HOME" is used to find the home directory.
867
868 A quick and very simple example of how to setup a .netrc to
869 allow curl to ftp to the machine host.domain.com with user name
870 'myself' and password 'secret' should look similar to:
871
872 machine host.domain.com login myself password secret
873
874 If this option is used twice, the second will again disable
875 netrc usage.
876
877 --netrc-optional
878 Very similar to --netrc, but this option makes the .netrc usage
879 optional and not mandatory as the --netrc does.
880
881 --negotiate
882 (HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate
883 method was designed by Microsoft and is used in their web appli‐
884 cations. It is primarily meant as a support for Kerberos5
885 authentication but may be also used along with another authenti‐
886 cation methods. For more information see IETF draft draft-
887 brezak-spnego-http-04.txt.
888
889 This option requires that the library was built with GSSAPI sup‐
890 port. This is not very common. Use -V/--version to see if your
891 version supports GSS-Negotiate.
892
893 When using this option, you must also provide a fake -u/--user
894 option to activate the authentication code properly. Sending a
895 '-u :' is enough as the user name and password from the -u
896 option aren't actually used.
897
898 If this option is used several times, the following occurrences
899 make no difference.
900
901 -N/--no-buffer
902 Disables the buffering of the output stream. In normal work sit‐
903 uations, curl will use a standard buffered output stream that
904 will have the effect that it will output the data in chunks, not
905 necessarily exactly when the data arrives. Using this option
906 will disable that buffering.
907
908 If this option is used twice, the second will again switch on
909 buffering.
910
911 --no-sessionid
912 (SSL) Disable curl's use of SSL session-ID caching. By default
913 all transfers are done using the cache. Note that while nothing
914 ever should get hurt by attempting to reuse SSL session-IDs,
915 there seem to be broken SSL implementations in the wild that may
916 require you to disable this in order for you to succeed. (Added
917 in 7.16.0)
918
919 If this option is used twice, the second will again switch on
920 use of the session cache.
921
922 --ntlm (HTTP) Enables NTLM authentication. The NTLM authentication
923 method was designed by Microsoft and is used by IIS web servers.
924 It is a proprietary protocol, reversed engineered by clever peo‐
925 ple and implemented in curl based on their efforts. This kind of
926 behavior should not be endorsed, you should encourage everyone
927 who uses NTLM to switch to a public and documented authentica‐
928 tion method instead. Such as Digest.
929
930 If you want to enable NTLM for your proxy authentication, then
931 use --proxy-ntlm.
932
933 This option requires that the library was built with SSL sup‐
934 port. Use -V/--version to see if your curl supports NTLM.
935
936 If this option is used several times, the following occurrences
937 make no difference.
938
939 -o/--output <file>
940 Write output to <file> instead of stdout. If you are using {} or
941 [] to fetch multiple documents, you can use '#' followed by a
942 number in the <file> specifier. That variable will be replaced
943 with the current string for the URL being fetched. Like in:
944
945 curl http://{one,two}.site.com -o "file_#1.txt"
946
947 or use several variables like:
948
949 curl http://{site,host}.host[1-5].com -o "#1_#2"
950
951 You may use this option as many times as you have number of
952 URLs.
953
954 See also the --create-dirs option to create the local directo‐
955 ries dynamically.
956
957 -O/--remote-name
958 Write output to a local file named like the remote file we get.
959 (Only the file part of the remote file is used, the path is cut
960 off.)
961
962 The remote file name to use for saving is extracted from the
963 given URL, nothing else.
964
965 You may use this option as many times as you have number of
966 URLs.
967
968 --pass <phrase>
969 (SSL/SSH) Pass phrase for the private key
970
971 If this option is used several times, the last one will be used.
972
973 --proxy-anyauth
974 Tells curl to pick a suitable authentication method when commu‐
975 nicating with the given proxy. This will cause an extra
976 request/response round-trip. (Added in 7.13.2)
977
978 If this option is used twice, the second will again disable the
979 proxy use-any authentication.
980
981 --proxy-basic
982 Tells curl to use HTTP Basic authentication when communicating
983 with the given proxy. Use --basic for enabling HTTP Basic with a
984 remote host. Basic is the default authentication method curl
985 uses with proxies.
986
987 If this option is used twice, the second will again disable
988 proxy HTTP Basic authentication.
989
990 --proxy-digest
991 Tells curl to use HTTP Digest authentication when communicating
992 with the given proxy. Use --digest for enabling HTTP Digest with
993 a remote host.
994
995 If this option is used twice, the second will again disable
996 proxy HTTP Digest.
997
998 --proxy-ntlm
999 Tells curl to use HTTP NTLM authentication when communicating
1000 with the given proxy. Use --ntlm for enabling NTLM with a remote
1001 host.
1002
1003 If this option is used twice, the second will again disable
1004 proxy HTTP NTLM.
1005
1006 -p/--proxytunnel
1007 When an HTTP proxy is used (-x/--proxy), this option will cause
1008 non-HTTP protocols to attempt to tunnel through the proxy
1009 instead of merely using it to do HTTP-like operations. The tun‐
1010 nel approach is made with the HTTP proxy CONNECT request and
1011 requires that the proxy allows direct connect to the remote port
1012 number curl wants to tunnel through to.
1013
1014 If this option is used twice, the second will again disable
1015 proxy tunnel.
1016
1017 --pubkey <key>
1018 (SSH) Public key file name. Allows you to provide your public
1019 key in this separate file.
1020
1021 If this option is used several times, the last one will be used.
1022
1023 -P/--ftp-port <address>
1024 (FTP) Reverses the initiator/listener roles when connecting with
1025 ftp. This switch makes Curl use the PORT command instead of
1026 PASV. In practise, PORT tells the server to connect to the
1027 client's specified address and port, while PASV asks the server
1028 for an ip address and port to connect to. <address> should be
1029 one of:
1030
1031 interface
1032 i.e "eth0" to specify which interface's IP address you
1033 want to use (Unix only)
1034
1035 IP address
1036 i.e "192.168.10.1" to specify exact IP number
1037
1038 host name
1039 i.e "my.host.domain" to specify machine
1040
1041 - make curl pick the same IP address that is already used
1042 for the control connection
1043
1044 If this option is used several times, the last one will be used. Dis‐
1045 able the use of PORT with --ftp-pasv. Disable the attempt to use the
1046 EPRT command instead of PORT by using --disable-eprt. EPRT is really
1047 PORT++.
1048
1049 -q If used as the first parameter on the command line, the curlrc
1050 config file will not be read and used. See the -K/--config for
1051 details on the default config file search path.
1052
1053 -Q/--quote <command>
1054 (FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP
1055 server. Quote commands are sent BEFORE the transfer is taking
1056 place (just after the initial PWD command in an FTP transfer, to
1057 be exact). To make commands take place after a successful trans‐
1058 fer, prefix them with a dash '-'. To make commands get sent
1059 after libcurl has changed working directory, just before the
1060 transfer command(s), prefix the command with '+' (this is only
1061 supported for FTP). You may specify any number of commands. If
1062 the server returns failure for one of the commands, the entire
1063 operation will be aborted. You must send syntactically correct
1064 FTP commands as RFC959 defines to FTP servers, or one of the
1065 following commands (with appropriate arguments) to SFTP servers:
1066 chgrp, chmod, chown, ln, mkdir, rename, rm, rmdir, symlink.
1067
1068 This option can be used multiple times.
1069
1070 --random-file <file>
1071 (SSL) Specify the path name to file containing what will be con‐
1072 sidered as random data. The data is used to seed the random
1073 engine for SSL connections. See also the --egd-file option.
1074
1075 -r/--range <range>
1076 (HTTP/FTP) Retrieve a byte range (i.e a partial document) from a
1077 HTTP/1.1 or FTP server. Ranges can be specified in a number of
1078 ways.
1079
1080 0-499 specifies the first 500 bytes
1081
1082 500-999 specifies the second 500 bytes
1083
1084 -500 specifies the last 500 bytes
1085
1086 9500- specifies the bytes from offset 9500 and forward
1087
1088 0-0,-1 specifies the first and last byte only(*)(H)
1089
1090 500-700,600-799
1091 specifies 300 bytes from offset 500(H)
1092
1093 100-199,500-599
1094 specifies two separate 100 bytes ranges(*)(H)
1095
1096 (*) = NOTE that this will cause the server to reply with a multipart
1097 response!
1098
1099 Only digit characters (0-9) are valid in 'start' and 'stop' of range
1100 syntax 'start-stop'. If a non-digit character is given in the range,
1101 the server's response will be indeterminable, depending on different
1102 server's configuration.
1103
1104 You should also be aware that many HTTP/1.1 servers do not have this
1105 feature enabled, so that when you attempt to get a range, you'll
1106 instead get the whole document.
1107
1108 FTP range downloads only support the simple syntax 'start-stop'
1109 (optionally with one of the numbers omitted). It depends on the non-RFC
1110 command SIZE.
1111
1112 If this option is used several times, the last one will be used.
1113
1114 --raw When used, it disables all internal HTTP decoding of content or
1115 transfer encodings and instead makes them passed on unaltered,
1116 raw. (Added in 7.16.2)
1117
1118 If this option is used several times, each occurrence toggles
1119 this on/off.
1120
1121 -R/--remote-time
1122 When used, this will make libcurl attempt to figure out the
1123 timestamp of the remote file, and if that is available make the
1124 local file get that same timestamp.
1125
1126 If this option is used twice, the second time disables this
1127 again.
1128
1129 --retry <num>
1130 If a transient error is returned when curl tries to perform a
1131 transfer, it will retry this number of times before giving up.
1132 Setting the number to 0 makes curl do no retries (which is the
1133 default). Transient error means either: a timeout, an FTP 5xx
1134 response code or an HTTP 5xx response code.
1135
1136 When curl is about to retry a transfer, it will first wait one
1137 second and then for all forthcoming retries it will double the
1138 waiting time until it reaches 10 minutes which then will be the
1139 delay between the rest of the retries. By using --retry-delay
1140 you disable this exponential backoff algorithm. See also
1141 --retry-max-time to limit the total time allowed for retries.
1142 (Added in 7.12.3)
1143
1144 If this option is used multiple times, the last occurrence
1145 decide the amount.
1146
1147 --retry-delay <seconds>
1148 Make curl sleep this amount of time between each retry when a
1149 transfer has failed with a transient error (it changes the
1150 default backoff time algorithm between retries). This option is
1151 only interesting if --retry is also used. Setting this delay to
1152 zero will make curl use the default backoff time. (Added in
1153 7.12.3)
1154
1155 If this option is used multiple times, the last occurrence
1156 decide the amount.
1157
1158 --retry-max-time <seconds>
1159 The retry timer is reset before the first transfer attempt.
1160 Retries will be done as usual (see --retry) as long as the timer
1161 hasn't reached this given limit. Notice that if the timer hasn't
1162 reached the limit, the request will be made and while perform‐
1163 ing, it may take longer than this given time period. To limit a
1164 single request´s maximum time, use -m/--max-time. Set this
1165 option to zero to not timeout retries. (Added in 7.12.3)
1166
1167 If this option is used multiple times, the last occurrence
1168 decide the amount.
1169
1170 -s/--silent
1171 Silent mode. Don't show progress meter or error messages. Makes
1172 Curl mute.
1173
1174 If this option is used twice, the second will again disable
1175 silent mode.
1176
1177 -S/--show-error
1178 When used with -s it makes curl show error message if it fails.
1179
1180 If this option is used twice, the second will again disable show
1181 error.
1182
1183 --socks4 <host[:port]>
1184 Use the specified SOCKS4 proxy. If the port number is not speci‐
1185 fied, it is assumed at port 1080. (Added in 7.15.2)
1186
1187 This option overrides any previous use of -x/--proxy, as they
1188 are mutually exclusive.
1189
1190 If this option is used several times, the last one will be used.
1191
1192 --socks5 <host[:port]>
1193 Use the specified SOCKS5 proxy. If the port number is not speci‐
1194 fied, it is assumed at port 1080. (Added in 7.11.1)
1195
1196 This option overrides any previous use of -x/--proxy, as they
1197 are mutually exclusive.
1198
1199 If this option is used several times, the last one will be used.
1200 (This option was previously wrongly documented and used as
1201 --socks without the number appended.)
1202
1203 --stderr <file>
1204 Redirect all writes to stderr to the specified file instead. If
1205 the file name is a plain '-', it is instead written to stdout.
1206 This option has no point when you're using a shell with decent
1207 redirecting capabilities.
1208
1209 If this option is used several times, the last one will be used.
1210
1211 --tcp-nodelay
1212 Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man
1213 page for details about this option. (Added in 7.11.2)
1214
1215 If this option is used several times, each occurrence toggles
1216 this on/off.
1217
1218 -t/--telnet-option <OPT=val>
1219 Pass options to the telnet protocol. Supported options are:
1220
1221 TTYPE=<term> Sets the terminal type.
1222
1223 XDISPLOC=<X display> Sets the X display location.
1224
1225 NEW_ENV=<var,val> Sets an environment variable.
1226
1227 -T/--upload-file <file>
1228 This transfers the specified local file to the remote URL. If
1229 there is no file part in the specified URL, Curl will append the
1230 local file name. NOTE that you must use a trailing / on the last
1231 directory to really prove to Curl that there is no file name or
1232 curl will think that your last directory name is the remote file
1233 name to use. That will most likely cause the upload operation to
1234 fail. If this is used on a http(s) server, the PUT command will
1235 be used.
1236
1237 Use the file name "-" (a single dash) to use stdin instead of a
1238 given file.
1239
1240 You can specify one -T for each URL on the command line. Each -T
1241 + URL pair specifies what to upload and to where. curl also sup‐
1242 ports "globbing" of the -T argument, meaning that you can upload
1243 multiple files to a single URL by using the same URL globbing
1244 style supported in the URL, like this:
1245
1246 curl -T "{file1,file2}" http://www.uploadtothissite.com
1247
1248 or even
1249
1250 curl -T "img[1-1000].png" ftp://ftp.picturemania.com/upload/
1251
1252 --trace <file>
1253 Enables a full trace dump of all incoming and outgoing data,
1254 including descriptive information, to the given output file. Use
1255 "-" as filename to have the output sent to stdout.
1256
1257 This option overrides previous uses of -v/--verbose or --trace-
1258 ascii.
1259
1260 If this option is used several times, the last one will be used.
1261
1262 --trace-ascii <file>
1263 Enables a full trace dump of all incoming and outgoing data,
1264 including descriptive information, to the given output file. Use
1265 "-" as filename to have the output sent to stdout.
1266
1267 This is very similar to --trace, but leaves out the hex part and
1268 only shows the ASCII part of the dump. It makes smaller output
1269 that might be easier to read for untrained humans.
1270
1271 This option overrides previous uses of -v/--verbose or --trace.
1272
1273 If this option is used several times, the last one will be used.
1274
1275 --trace-time
1276 Prepends a time stamp to each trace or verbose line that curl
1277 displays. (Added in 7.14.0)
1278
1279 If this option is used several times, each occurrence will tog‐
1280 gle it on/off.
1281
1282 -u/--user <user:password>
1283 Specify user and password to use for server authentication.
1284 Overrides -n/--netrc and --netrc-optional.
1285
1286 If you use an SSPI-enabled curl binary and do NTLM authentica‐
1287 tion, you can force curl to pick up the user name and password
1288 from your environment by simply specifying a single colon with
1289 this option: "-u :".
1290
1291 If this option is used several times, the last one will be used.
1292
1293 -U/--proxy-user <user:password>
1294 Specify user and password to use for proxy authentication.
1295
1296 If you use an SSPI-enabled curl binary and do NTLM authentica‐
1297 tion, you can force curl to pick up the user name and password
1298 from your environment by simply specifying a single colon with
1299 this option: "-U :".
1300
1301 If this option is used several times, the last one will be used.
1302
1303 --url <URL>
1304 Specify a URL to fetch. This option is mostly handy when you
1305 want to specify URL(s) in a config file.
1306
1307 This option may be used any number of times. To control where
1308 this URL is written, use the -o/--output or the -O/--remote-name
1309 options.
1310
1311 -v/--verbose
1312 Makes the fetching more verbose/talkative. Mostly usable for
1313 debugging. Lines starting with '>' means "header data" sent by
1314 curl, '<' means "header data" received by curl that is hidden in
1315 normal cases and lines starting with '*' means additional info
1316 provided by curl.
1317
1318 Note that if you only want HTTP headers in the output,
1319 -i/--include might be option you're looking for.
1320
1321 If you think this option still doesn't give you enough details,
1322 consider using --trace or --trace-ascii instead.
1323
1324 This option overrides previous uses of --trace-ascii or --trace.
1325
1326 If this option is used twice, the second will do nothing extra.
1327
1328 -V/--version
1329 Displays information about curl and the libcurl version it uses.
1330
1331 The first line includes the full version of curl, libcurl and
1332 other 3rd party libraries linked with the executable.
1333
1334 The second line (starts with "Protocols:") shows all protocols
1335 that libcurl reports to support.
1336
1337 The third line (starts with "Features:") shows specific features
1338 libcurl reports to offer. Available features include:
1339
1340 IPv6 You can use IPv6 with this.
1341
1342 krb4 Krb4 for ftp is supported.
1343
1344 SSL HTTPS and FTPS are supported.
1345
1346 libz Automatic decompression of compressed files over HTTP is
1347 supported.
1348
1349 NTLM NTLM authentication is supported.
1350
1351 GSS-Negotiate
1352 Negotiate authentication and krb5 for ftp is supported.
1353
1354 Debug This curl uses a libcurl built with Debug. This enables
1355 more error-tracking and memory debugging etc. For curl-
1356 developers only!
1357
1358 AsynchDNS
1359 This curl uses asynchronous name resolves.
1360
1361 SPNEGO SPNEGO Negotiate authentication is supported.
1362
1363 Largefile
1364 This curl supports transfers of large files, files larger
1365 than 2GB.
1366
1367 IDN This curl supports IDN - international domain names.
1368
1369 SSPI SSPI is supported. If you use NTLM and set a blank user
1370 name, curl will authenticate with your current user and
1371 password.
1372
1373 -w/--write-out <format>
1374 Defines what to display on stdout after a completed and success‐
1375 ful operation. The format is a string that may contain plain
1376 text mixed with any number of variables. The string can be spec‐
1377 ified as "string", to get read from a particular file you spec‐
1378 ify it "@filename" and to tell curl to read the format from
1379 stdin you write "@-".
1380
1381 The variables present in the output format will be substituted
1382 by the value or text that curl thinks fit, as described below.
1383 All variables are specified like %{variable_name} and to output
1384 a normal % you just write them like %%. You can output a newline
1385 by using \n, a carriage return with \r and a tab space with \t.
1386
1387 NOTE: The %-letter is a special letter in the win32-environment,
1388 where all occurrences of % must be doubled when using this
1389 option.
1390
1391 Available variables are at this point:
1392
1393 url_effective The URL that was fetched last. This is mostly
1394 meaningful if you've told curl to follow loca‐
1395 tion: headers.
1396
1397 http_code The numerical code that was found in the last
1398 retrieved HTTP(S) page.
1399
1400 http_connect The numerical code that was found in the last
1401 response (from a proxy) to a curl CONNECT
1402 request. (Added in 7.12.4)
1403
1404 time_total The total time, in seconds, that the full opera‐
1405 tion lasted. The time will be displayed with mil‐
1406 lisecond resolution.
1407
1408 time_namelookup
1409 The time, in seconds, it took from the start
1410 until the name resolving was completed.
1411
1412 time_connect The time, in seconds, it took from the start
1413 until the connect to the remote host (or proxy)
1414 was completed.
1415
1416 time_pretransfer
1417 The time, in seconds, it took from the start
1418 until the file transfer is just about to begin.
1419 This includes all pre-transfer commands and nego‐
1420 tiations that are specific to the particular pro‐
1421 tocol(s) involved.
1422
1423 time_redirect The time, in seconds, it took for all redirection
1424 steps include name lookup, connect, pretransfer
1425 and transfer before final transaction was
1426 started. time_redirect shows the complete execu‐
1427 tion time for multiple redirections. (Added in
1428 7.12.3)
1429
1430 time_starttransfer
1431 The time, in seconds, it took from the start
1432 until the first byte is just about to be trans‐
1433 ferred. This includes time_pretransfer and also
1434 the time the server needs to calculate the
1435 result.
1436
1437 size_download The total amount of bytes that were downloaded.
1438
1439 size_upload The total amount of bytes that were uploaded.
1440
1441 size_header The total amount of bytes of the downloaded head‐
1442 ers.
1443
1444 size_request The total amount of bytes that were sent in the
1445 HTTP request.
1446
1447 speed_download The average download speed that curl measured for
1448 the complete download.
1449
1450 speed_upload The average upload speed that curl measured for
1451 the complete upload.
1452
1453 content_type The Content-Type of the requested document, if
1454 there was any.
1455
1456 num_connects Number of new connects made in the recent trans‐
1457 fer. (Added in 7.12.3)
1458
1459 num_redirects Number of redirects that were followed in the
1460 request. (Added in 7.12.3)
1461
1462 ftp_entry_path The initial path libcurl ended up in when logging
1463 on to the remote FTP server. (Added in 7.15.4)
1464
1465 If this option is used several times, the last one will be used.
1466
1467 -x/--proxy <proxyhost[:port]>
1468 Use specified HTTP proxy. If the port number is not specified,
1469 it is assumed at port 1080.
1470
1471 This option overrides existing environment variables that sets
1472 proxy to use. If there's an environment variable setting a
1473 proxy, you can set proxy to "" to override it.
1474
1475 Note that all operations that are performed over a HTTP proxy
1476 will transparently be converted to HTTP. It means that certain
1477 protocol specific operations might not be available. This is not
1478 the case if you can tunnel through the proxy, as done with the
1479 -p/--proxytunnel option.
1480
1481 Starting with 7.14.1, the proxy host can be specified the exact
1482 same way as the proxy environment variables, include protocol
1483 prefix (http://) and embedded user + password.
1484
1485 If this option is used several times, the last one will be used.
1486
1487 -X/--request <command>
1488 (HTTP) Specifies a custom request method to use when communicat‐
1489 ing with the HTTP server. The specified request will be used
1490 instead of the method otherwise used (which defaults to GET).
1491 Read the HTTP 1.1 specification for details and explanations.
1492
1493 (FTP) Specifies a custom FTP command to use instead of LIST when
1494 doing file lists with ftp.
1495
1496 If this option is used several times, the last one will be used.
1497
1498 -y/--speed-time <time>
1499 If a download is slower than speed-limit bytes per second during
1500 a speed-time period, the download gets aborted. If speed-time is
1501 used, the default speed-limit will be 1 unless set with -y.
1502
1503 This option controls transfers and thus will not affect slow
1504 connects etc. If this is a concern for you, try the --connect-
1505 timeout option.
1506
1507 If this option is used several times, the last one will be used.
1508
1509 -Y/--speed-limit <speed>
1510 If a download is slower than this given speed, in bytes per sec‐
1511 ond, for speed-time seconds it gets aborted. speed-time is set
1512 with -Y and is 30 if not set.
1513
1514 If this option is used several times, the last one will be used.
1515
1516 -z/--time-cond <date expression>
1517 (HTTP/FTP) Request a file that has been modified later than the
1518 given time and date, or one that has been modified before that
1519 time. The date expression can be all sorts of date strings or if
1520 it doesn't match any internal ones, it tries to get the time
1521 from a given file name instead! See the curl_getdate(3) man
1522 pages for date expression details.
1523
1524 Start the date expression with a dash (-) to make it request for
1525 a document that is older than the given date/time, default is a
1526 document that is newer than the specified date/time.
1527
1528 If this option is used several times, the last one will be used.
1529
1530 --max-redirs <num>
1531 Set maximum number of redirection-followings allowed. If
1532 -L/--location is used, this option can be used to prevent curl
1533 from following redirections "in absurdum". By default, the limit
1534 is set to 50 redirections. Set this option to -1 to make it lim‐
1535 itless.
1536
1537 If this option is used several times, the last one will be used.
1538
1539 -0/--http1.0
1540 (HTTP) Forces curl to issue its requests using HTTP 1.0 instead
1541 of using its internally preferred: HTTP 1.1.
1542
1543 -1/--tlsv1
1544 (SSL) Forces curl to use TSL version 1 when negotiating with a
1545 remote TLS server.
1546
1547 -2/--sslv2
1548 (SSL) Forces curl to use SSL version 2 when negotiating with a
1549 remote SSL server.
1550
1551 -3/--sslv3
1552 (SSL) Forces curl to use SSL version 3 when negotiating with a
1553 remote SSL server.
1554
1555 -4/--ipv4
1556 If libcurl is capable of resolving an address to multiple IP
1557 versions (which it is if it is ipv6-capable), this option tells
1558 libcurl to resolve names to IPv4 addresses only.
1559
1560 -6/--ipv6
1561 If libcurl is capable of resolving an address to multiple IP
1562 versions (which it is if it is ipv6-capable), this option tells
1563 libcurl to resolve names to IPv6 addresses only.
1564
1565 -#/--progress-bar
1566 Make curl display progress information as a progress bar instead
1567 of the default statistics.
1568
1569 If this option is used twice, the second will again disable the
1570 progress bar.
1571
1573 ~/.curlrc
1574 Default config file, see -K/--config for details.
1575
1576
1578 http_proxy [protocol://]<host>[:port]
1579 Sets proxy server to use for HTTP.
1580
1581 HTTPS_PROXY [protocol://]<host>[:port]
1582 Sets proxy server to use for HTTPS.
1583
1584 FTP_PROXY [protocol://]<host>[:port]
1585 Sets proxy server to use for FTP.
1586
1587 ALL_PROXY [protocol://]<host>[:port]
1588 Sets proxy server to use if no protocol-specific proxy is set.
1589
1590 NO_PROXY <comma-separated list of hosts>
1591 list of host names that shouldn't go through any proxy. If set
1592 to a asterisk '*' only, it matches all hosts.
1593
1595 There exists a bunch of different error codes and their corresponding
1596 error messages that may appear during bad conditions. At the time of
1597 this writing, the exit codes are:
1598
1599 1 Unsupported protocol. This build of curl has no support for this
1600 protocol.
1601
1602 2 Failed to initialize.
1603
1604 3 URL malformat. The syntax was not correct.
1605
1606 4 URL user malformatted. The user-part of the URL syntax was not
1607 correct.
1608
1609 5 Couldn't resolve proxy. The given proxy host could not be
1610 resolved.
1611
1612 6 Couldn't resolve host. The given remote host was not resolved.
1613
1614 7 Failed to connect to host.
1615
1616 8 FTP weird server reply. The server sent data curl couldn't
1617 parse.
1618
1619 9 FTP access denied. The server denied login or denied access to
1620 the particular resource or directory you wanted to reach. Most
1621 often you tried to change to a directory that doesn't exist on
1622 the server.
1623
1624 10 FTP user/password incorrect. Either one or both were not
1625 accepted by the server.
1626
1627 11 FTP weird PASS reply. Curl couldn't parse the reply sent to the
1628 PASS request.
1629
1630 12 FTP weird USER reply. Curl couldn't parse the reply sent to the
1631 USER request.
1632
1633 13 FTP weird PASV reply, Curl couldn't parse the reply sent to the
1634 PASV request.
1635
1636 14 FTP weird 227 format. Curl couldn't parse the 227-line the
1637 server sent.
1638
1639 15 FTP can't get host. Couldn't resolve the host IP we got in the
1640 227-line.
1641
1642 16 FTP can't reconnect. Couldn't connect to the host we got in the
1643 227-line.
1644
1645 17 FTP couldn't set binary. Couldn't change transfer method to
1646 binary.
1647
1648 18 Partial file. Only a part of the file was transferred.
1649
1650 19 FTP couldn't download/access the given file, the RETR (or simi‐
1651 lar) command failed.
1652
1653 20 FTP write error. The transfer was reported bad by the server.
1654
1655 21 FTP quote error. A quote command returned error from the server.
1656
1657 22 HTTP page not retrieved. The requested url was not found or
1658 returned another error with the HTTP error code being 400 or
1659 above. This return code only appears if -f/--fail is used.
1660
1661 23 Write error. Curl couldn't write data to a local filesystem or
1662 similar.
1663
1664 24 Malformed user. User name badly specified.
1665
1666 25 FTP couldn't STOR file. The server denied the STOR operation,
1667 used for FTP uploading.
1668
1669 26 Read error. Various reading problems.
1670
1671 27 Out of memory. A memory allocation request failed.
1672
1673 28 Operation timeout. The specified time-out period was reached
1674 according to the conditions.
1675
1676 29 FTP couldn't set ASCII. The server returned an unknown reply.
1677
1678 30 FTP PORT failed. The PORT command failed. Not all FTP servers
1679 support the PORT command, try doing a transfer using PASV
1680 instead!
1681
1682 31 FTP couldn't use REST. The REST command failed. This command is
1683 used for resumed FTP transfers.
1684
1685 32 FTP couldn't use SIZE. The SIZE command failed. The command is
1686 an extension to the original FTP spec RFC 959.
1687
1688 33 HTTP range error. The range "command" didn't work.
1689
1690 34 HTTP post error. Internal post-request generation error.
1691
1692 35 SSL connect error. The SSL handshaking failed.
1693
1694 36 FTP bad download resume. Couldn't continue an earlier aborted
1695 download.
1696
1697 37 FILE couldn't read file. Failed to open the file. Permissions?
1698
1699 38 LDAP cannot bind. LDAP bind operation failed.
1700
1701 39 LDAP search failed.
1702
1703 40 Library not found. The LDAP library was not found.
1704
1705 41 Function not found. A required LDAP function was not found.
1706
1707 42 Aborted by callback. An application told curl to abort the oper‐
1708 ation.
1709
1710 43 Internal error. A function was called with a bad parameter.
1711
1712 44 Internal error. A function was called in a bad order.
1713
1714 45 Interface error. A specified outgoing interface could not be
1715 used.
1716
1717 46 Bad password entered. An error was signalled when the password
1718 was entered.
1719
1720 47 Too many redirects. When following redirects, curl hit the maxi‐
1721 mum amount.
1722
1723 48 Unknown TELNET option specified.
1724
1725 49 Malformed telnet option.
1726
1727 51 The remote peer's SSL certificate wasn't ok
1728
1729 52 The server didn't reply anything, which here is considered an
1730 error.
1731
1732 53 SSL crypto engine not found
1733
1734 54 Cannot set SSL crypto engine as default
1735
1736 55 Failed sending network data
1737
1738 56 Failure in receiving network data
1739
1740 57 Share is in use (internal error)
1741
1742 58 Problem with the local certificate
1743
1744 59 Couldn't use specified SSL cipher
1745
1746 60 Problem with the CA cert (path? permission?)
1747
1748 61 Unrecognized transfer encoding
1749
1750 62 Invalid LDAP URL
1751
1752 63 Maximum file size exceeded
1753
1754 64 Requested FTP SSL level failed
1755
1756 65 Sending the data requires a rewind that failed
1757
1758 66 Failed to initialise SSL Engine
1759
1760 67 User, password or similar was not accepted and curl failed to
1761 login
1762
1763 68 File not found on TFTP server
1764
1765 69 Permission problem on TFTP server
1766
1767 70 Out of disk space on TFTP server
1768
1769 71 Illegal TFTP operation
1770
1771 72 Unknown TFTP transfer ID
1772
1773 73 File already exists (TFTP)
1774
1775 74 No such user (TFTP)
1776
1777 75 Character conversion failed
1778
1779 76 Character conversion functions required
1780
1781 XX There will appear more error codes here in future releases. The
1782 existing ones are meant to never change.
1783
1785 Daniel Stenberg is the main author, but the whole list of contributors
1786 is found in the separate THANKS file.
1787
1789 http://curl.haxx.se
1790
1792 ftp://ftp.sunet.se/pub/www/utilities/curl/
1793
1795 ftp(1), wget(1)
1796
1797
1798
1799
1800Curl 7.16.2 28 Feb 2007 curl(1)