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