]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/curl/docs/curl.1
hello world
[icculus/iodoom3.git] / neo / curl / docs / curl.1
1 .\" You can view this file with:
2 .\" nroff -man curl.1
3 .\" Written by Daniel Stenberg
4 .\"
5 .TH curl 1 "5 Mar 2004" "Curl 7.11.1" "Curl Manual"
6 .SH NAME
7 curl \- transfer a URL
8 .SH SYNOPSIS
9 .B curl [options]
10 .I [URL...]
11 .SH DESCRIPTION
12 .B curl
13 is a tool to transfer data from or to a server, using one of the supported
14 protocols (HTTP, HTTPS, FTP, FTPS, GOPHER, DICT, TELNET, LDAP or FILE). The
15 command is designed to work without user interaction.
16
17 curl offers a busload of useful tricks like proxy support, user
18 authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file
19 transfer 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 .BR libcurl (3)
24 for details.
25 .SH URL
26 The URL syntax is protocol dependent. You'll find a detailed description in
27 RFC 2396.
28
29 You can specify multiple URLs or parts of URLs by writing part sets within
30 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:
41
42  http://www.any.org/archive[1996-1999]/volume[1-4]part{a,b,c,index}.html
43
44 You can specify any amount of URLs on the command line. They will be fetched
45 in a sequential manner in the specified order.
46
47 Curl will attempt to re-use connections for multiple file transfers, so that
48 getting many files from the same server will not do multiple connects /
49 handshakes. This improves speed. Of course this is only done on files
50 specified on a single command line and cannot be used between separate curl
51 invokes.
52 .SH OPTIONS
53 .IP "-a/--append"
54 (FTP) When used in an FTP upload, this will tell curl to append to the target
55 file instead of overwriting it. If the file doesn't exist, it will be created.
56
57 If this option is used twice, the second one will disable append mode again.
58 .IP "-A/--user-agent <agent string>"
59 (HTTP) Specify the User-Agent string to send to the HTTP server. Some badly
60 done CGIs fail if its not set to "Mozilla/4.0".  To encode blanks in the
61 string, surround the string with single quote marks.  This can also be set
62 with the \fI-H/--header\fP option of course.
63
64 If this option is set more than once, the last one will be the one that's
65 used.
66 .IP "--anyauth"
67 (HTTP) Tells curl to figure out authentication method by itself, and use the
68 most secure one the remote site claims it supports. This is done by first
69 doing a request and checking the response-headers, thus inducing an extra
70 network round-trip. This is used instead of setting a specific authentication
71 method, which you can do with \fI--basic\fP, \fI--digest\fP, \fI--ntlm\fP, and
72 \fI--negotiate\fP. (Added in 7.10.6)
73
74 If this option is used several times, the following occurrences make no
75 difference.
76 .IP "-b/--cookie <name=data>"
77 (HTTP)
78 Pass the data to the HTTP server as a cookie. It is supposedly the
79 data previously received from the server in a "Set-Cookie:" line.
80 The data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
81
82 If no '=' letter is used in the line, it is treated as a filename to use to
83 read previously stored cookie lines from, which should be used in this session
84 if they match. Using this method also activates the "cookie parser" which will
85 make curl record incoming cookies too, which may be handy if you're using this
86 in combination with the \fI-L/--location\fP option. The file format of the
87 file to read cookies from should be plain HTTP headers or the Netscape/Mozilla
88 cookie file format.
89
90 \fBNOTE\fP that the file specified with \fI-b/--cookie\fP is only used as
91 input. No cookies will be stored in the file. To store cookies, use the
92 \fI-c/--cookie-jar\fP option or you could even save the HTTP headers to a file
93 using \fI-D/--dump-header\fP!
94
95 If this option is set more than once, the last one will be the one that's
96 used.
97 .IP "-B/--use-ascii"
98 Use ASCII transfer when getting an FTP file or LDAP info. For FTP, this can
99 also be enforced by using an URL that ends with ";type=A". This option causes
100 data sent to stdout to be in text mode for win32 systems.
101
102 If this option is used twice, the second one will disable ASCII usage.
103 .IP "--basic"
104 (HTTP) Tells curl to use HTTP Basic authentication. This is the default and
105 this option is usually pointless, unless you use it to override a previously
106 set option that sets a different authentication method (such as \fI--ntlm\fP,
107 \fI--digest\fP and \fI--negotiate\fP). (Added in 7.10.6)
108
109 If this option is used several times, the following occurrences make no
110 difference.
111 .IP "--ciphers <list of ciphers>"
112 (SSL) Specifies which ciphers to use in the connection. The list of ciphers
113 must be using valid ciphers. Read up on SSL cipher list details on this URL:
114 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
115
116 If this option is used several times, the last one will override the others.
117 .IP "--compressed"
118 (HTTP) Request a compressed response using one of the algorithms libcurl
119 supports, and return the uncompressed document.  If this option is used and
120 the server sends an unsupported encoding, Curl will report an error.
121
122 If this option is used several times, each occurrence will toggle it on/off.
123 .IP "--connect-timeout <seconds>"
124 Maximum time in seconds that you allow the connection to the server to take.
125 This only limits the connection phase, once curl has connected this option is
126 of no more use. See also the \fI--max-time\fP option.
127
128 If this option is used several times, the last one will be used.
129 .IP "-c/--cookie-jar <file name>"
130 Specify to which file you want curl to write all cookies after a completed
131 operation. Curl writes all cookies previously read from a specified file as
132 well as all cookies received from remote server(s). If no cookies are known,
133 no file will be written. The file will be written using the Netscape cookie
134 file format. If you set the file name to a single dash, "-", the cookies will
135 be written to stdout.
136
137 .B NOTE
138 If the cookie jar can't be created or written to, the whole curl operation
139 won't fail or even report an error clearly. Using -v will get a warning
140 displayed, but that is the only visible feedback you get about this possibly
141 lethal situation.
142
143 If this option is used several times, the last specfied file name will be
144 used.
145 .IP "-C/--continue-at <offset>"
146 Continue/Resume a previous file transfer at the given offset. The given offset
147 is the exact number of bytes that will be skipped counted from the beginning
148 of the source file before it is transfered to the destination.  If used with
149 uploads, the ftp server command SIZE will not be used by curl.
150
151 Use "-C -" to tell curl to automatically find out where/how to resume the
152 transfer. It then uses the given output/input files to figure that out.
153
154 If this option is used several times, the last one will be used.
155 .IP "--create-dirs"
156 When used in conjunction with the -o option, curl will create the necessary 
157 local directory hierarchy as needed.
158 .IP "--crlf"
159 (FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
160
161 If this option is used twice, the second will again disable crlf converting.
162 .IP "-d/--data <data>"
163 (HTTP) Sends the specified data in a POST request to the HTTP server, in a way
164 that can emulate as if a user has filled in a HTML form and pressed the submit
165 button. Note that the data is sent exactly as specified with no extra
166 processing (with all newlines cut off).  The data is expected to be
167 \&"url-encoded". This will cause curl to pass the data to the server using the
168 content-type application/x-www-form-urlencoded. Compare to \fI-F/--form\fP. If
169 this option is used more than once on the same command line, the data pieces
170 specified will be merged together with a separating &-letter. Thus, using '-d
171 name=daniel -d skill=lousy' would generate a post chunk that looks like
172 \&'name=daniel&skill=lousy'.
173
174 If you start the data with the letter @, the rest should be a file name to
175 read the data from, or - if you want curl to read the data from stdin.  The
176 contents of the file must already be url-encoded. Multiple files can also be
177 specified. Posting data from a file named 'foobar' would thus be done with
178 \fI--data\fP @foobar".
179
180 To post data purely binary, you should instead use the \fI--data-binary\fP
181 option.
182
183 \fI-d/--data\fP is the same as \fI--data-ascii\fP.
184
185 If this option is used several times, the ones following the first will
186 append data.
187 .IP "--data-ascii <data>"
188 (HTTP) This is an alias for the \fI-d/--data\fP option.
189
190 If this option is used several times, the ones following the first will
191 append data.
192 .IP "--data-binary <data>"
193 (HTTP) This posts data in a similar manner as \fI--data-ascii\fP does,
194 although when using this option the entire context of the posted data is kept
195 as-is. If you want to post a binary file without the strip-newlines feature of
196 the \fI--data-ascii\fP option, this is for you.
197
198 If this option is used several times, the ones following the first will
199 append data.
200 .IP "--digest"
201 (HTTP) Enables HTTP Digest authentication. This is a authentication that
202 prevents the password from being sent over the wire in clear text. Use this in
203 combination with the normal \fI-u/--user\fP option to set user name and
204 password. See also \fI--ntlm\fP, \fI--negotiate\fP and \fI--anyauth\fP for
205 related options. (Added in curl 7.10.6)
206
207 If this option is used several times, the following occurrences make no
208 difference.
209 .IP "--disable-eprt"
210 (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing
211 active FTP transfers. Curl will normally always first attempt to use EPRT,
212 then LPRT before using PORT, but with this option, it will use PORT right
213 away. EPRT and LPRT are extensions to the original FTP protocol, may not work
214 on all servers but enable more functionality in a better way than the
215 traditional PORT command. (Aded in 7.10.5)
216
217 If this option is used several times, each occurrence will toggle this on/off.
218 .IP "--disable-epsv"
219 (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP
220 transfers. Curl will normally always first attempt to use EPSV before PASV,
221 but with this option, it will not try using EPSV.
222
223 If this option is used several times, each occurrence will toggle this on/off.
224 .IP "-D/--dump-header <file>"
225 Write the protocol headers to the specified file.
226
227 This option is handy to use when you want to store the headers that a HTTP
228 site sends to you. Cookies from the headers could then be read in a second
229 curl invoke by using the \fI-b/--cookie\fP option! The \fI-c/--cookie-jar\fP
230 option is however a better way to store cookies.
231
232 When used on FTP, the ftp server response lines are considered being "headers"
233 and thus are saved there.
234
235 If this option is used several times, the last one will be used.
236 .IP "-e/--referer <URL>"
237 (HTTP) Sends the "Referer Page" information to the HTTP server. This can also
238 be set with the \fI-H/--header\fP flag of course.  When used with
239 \fI-L/--location\fP you can append ";auto" to the referer URL to make curl
240 automatically set the previous URL when it follows a Location: header. The
241 ";auto" string can be used alone, even if you don't set an initial referer.
242
243 If this option is used several times, the last one will be used.
244 .IP "--environment"
245 (RISC OS ONLY) Sets a range of environment variables, using the names the -w
246 option supports, to easier allow extraction of useful information after having
247 run curl.
248
249 If this option is used several times, each occurrence will toggle this on/off.
250 .IP "--egd-file <file>"
251 (HTTPS) Specify the path name to the Entropy Gathering Daemon socket. The
252 socket is used to seed the random engine for SSL connections. See also the
253 \fI--random-file\fP option.
254 .IP "-E/--cert <certificate[:password]>"
255 (HTTPS)
256 Tells curl to use the specified certificate file when getting a file
257 with HTTPS. The certificate must be in PEM format.
258 If the optional password isn't specified, it will be queried for on
259 the terminal. Note that this certificate is the private key and the private
260 certificate concatenated!
261
262 If this option is used several times, the last one will be used.
263 .IP "--cert-type <type>"
264 (SSL) Tells curl what certificate type the provided certificate is in. PEM,
265 DER and ENG are recognized types.
266
267 If this option is used several times, the last one will be used.
268 .IP "--cacert <CA certificate>"
269 (HTTPS) Tells curl to use the specified certificate file to verify the
270 peer. The file may contain multiple CA certificates. The certificate(s) must
271 be in PEM format.
272
273 curl recognizes the environment variable named 'CURL_CA_BUNDLE' if that is
274 set, and uses the given path as a path to a CA cert bundle. This option
275 overrides that variable.
276
277 The windows version of curl will automatically look for a CA certs file named
278 \'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in the
279 Current Working Directory, or in any folder along your PATH.
280
281 If this option is used several times, the last one will be used.
282 .IP "--capath <CA certificate directory>"
283 (HTTPS) Tells curl to use the specified certificate directory to verify the
284 peer. The certificates must be in PEM format, and the directory must have been
285 processed using the c_rehash utility supplied with openssl. Using
286 \fI--capath\fP can allow curl to make https connections much more efficiently
287 than using \fI--cacert\fP if the \fI--cacert\fP file contains many CA
288 certificates.
289
290 If this option is used several times, the last one will be used.
291 .IP "-f/--fail"
292 (HTTP) Fail silently (no output at all) on server errors. This is mostly done
293 like this to better enable scripts etc to better deal with failed attempts. In
294 normal cases when a HTTP server fails to deliver a document, it returns a HTML
295 document stating so (which often also describes why and more). This flag will
296 prevent curl from outputting that and fail silently instead.
297
298 If this option is used twice, the second will again disable silent failure.
299 .IP "--ftp-create-dirs"
300 (FTP) When an FTP URL/operation uses a path that doesn't currently exist on
301 the server, the standard behavior of curl is to fail. Using this option, curl
302 will instead attempt to create missing directories. (Added in 7.10.7)
303
304 If this option is used twice, the second will again disable silent failure.
305 .IP "--ftp-pasv"
306 (FTP) Use PASV when transfering. PASV is the internal default behavior, but
307 using this option can be used to override a previos --ftp-port option. (Added
308 in 7.11.0)
309
310 If this option is used twice, the second will again disable silent failure.
311 .IP "--ftp-ssl"
312 (FTP) Make the FTP connection switch to use SSL/TLS. (Added in 7.11.0)
313
314 If this option is used twice, the second will again disable silent failure.
315 .IP "-F/--form <name=content>"
316 (HTTP) This lets curl emulate a filled in form in which a user has pressed the
317 submit button. This causes curl to POST data using the content-type
318 multipart/form-data according to RFC1867. This enables uploading of binary
319 files etc. To force the 'content' part to be be a file, prefix the file name
320 with an @ sign. To just get the content part from a file, prefix the file name
321 with the letter <. The difference between @ and < is then that @ makes a file
322 get attached in the post as a file upload, while the < makes a text field and
323 just get the contents for that text field from a file.
324
325 Example, to send your password file to the server, where
326 \&'password' is the name of the form-field to which /etc/passwd will be the
327 input:
328
329 \fBcurl\fP -F password=@/etc/passwd www.mypasswords.com
330
331 To read the file's content from stdin insted of a file, use - where the file
332 name should've been. This goes for both @ and < constructs.
333
334 You can also tell curl what Content-Type to use for the file upload part, by
335 using 'type=', in a manner similar to:
336
337 \fBcurl\fP -F "web=@index.html;type=text/html" url.com
338
339 See further examples and details in the MANUAL.
340
341 This option can be used multiple times.
342 .IP "-g/--globoff"
343 This option switches off the "URL globbing parser". When you set this option,
344 you can specify URLs that contain the letters {}[] without having them being
345 interpreted by curl itself. Note that these letters are not normal legal URL
346 contents but they should be encoded according to the URI standard.
347 .IP "-G/--get"
348 When used, this option will make all data specified with \fI-d/--data\fP or
349 \fI--data-binary\fP to be used in a HTTP GET request instead of the POST
350 request that otherwise would be used. The data will be appended to the URL
351 with a '?'  separator.
352
353 If used in combination with -I, the POST data will instead be appended to the
354 URL with a HEAD request.
355
356 If used multiple times, nothing special happens.
357 .IP "-h/--help"
358 Usage help.
359 .IP "-H/--header <header>"
360 (HTTP) Extra header to use when getting a web page. You may specify any number
361 of extra headers. Note that if you should add a custom header that has the
362 same name as one of the internal ones curl would use, your externally set
363 header will be used instead of the internal one. This allows you to make even
364 trickier stuff than curl would normally do. You should not replace internally
365 set headers without knowing perfectly well what you're doing. Replacing an
366 internal header with one without content on the right side of the colon will
367 prevent that header from appearing.
368
369 See also the \fI-A/--user-agent\fP and \fI-e/--referer\fP options.
370
371 This option can be used multiple times to add/replace/remove multiple headers.
372 .IP "-i/--include"
373 (HTTP)
374 Include the HTTP-header in the output. The HTTP-header includes things
375 like server-name, date of the document, HTTP-version and more...
376
377 If this option is used twice, the second will again disable header include.
378 .IP "--interface <name>"
379 Perform an operation using a specified interface. You can enter interface
380 name, IP address or host name. An example could look like:
381
382  curl --interface eth0:1 http://www.netscape.com/
383
384 If this option is used several times, the last one will be used.
385 .IP "-I/--head"
386 (HTTP/FTP/FILE)
387 Fetch the HTTP-header only! HTTP-servers feature the command HEAD
388 which this uses to get nothing but the header of a document. When used
389 on a FTP or FILE file, curl displays the file size and last modification
390 time only.
391
392 If this option is used twice, the second will again disable header only.
393 .IP "-j/--junk-session-cookies"
394 (HTTP) When curl is told to read cookies from a given file, this option will
395 make it discard all "session cookies". This will basicly have the same effect
396 as if a new session is started. Typical browsers always discard session
397 cookies when they're closed down. (Added in 7.9.7)
398
399 If this option is used several times, each occurrence will toggle this on/off.
400 .IP "-k/--insecure"
401 (SSL) This option explicitly allows curl to perform "insecure" SSL connections
402 and transfers. Starting with curl 7.10, all SSL connections will be attempted
403 to be made secure by using the CA certificate bundle installed by
404 default. This makes all connections considered "insecure" to fail unless
405 \fI-k/--insecure\fP is used.
406
407 If this option is used twice, the second time will again disable it.
408 .IP "--key <key>"
409 (SSL) Private key file name. Allows you to provide your private key in this
410 separate file.
411
412 If this option is used several times, the last one will be used.
413 .IP "--key-type <type>"
414 (SSL) Private key file type. Specify which type your \fI--key\fP provided
415 private key is. DER, PEM and ENG are supported.
416
417 If this option is used several times, the last one will be used.
418 .IP "--krb4 <level>"
419 (FTP) Enable kerberos4 authentication and use. The level must be entered and
420 should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
421 a level that is not one of these, 'private' will instead be used.
422
423 This option requiures that the library was built with kerberos4 support. This
424 is not very common. Use \fI-V/--version\fP to see if your curl supports it.
425
426 If this option is used several times, the last one will be used.
427 .IP "-K/--config <config file>"
428 Specify which config file to read curl arguments from. The config file is a
429 text file in which command line arguments can be written which then will be
430 used as if they were written on the actual command line. Options and their
431 parameters must be specified on the same config file line. If the parameter is
432 to contain white spaces, the parameter must be inclosed within quotes.  If the
433 first column of a config line is a '#' character, the rest of the line will be
434 treated as a comment.
435
436 Specify the filename as '-' to make curl read the file from stdin.
437
438 Note that to be able to specify a URL in the config file, you need to specify
439 it using the \fI--url\fP option, and not by simply writing the URL on its own
440 line. So, it could look similar to this:
441
442 url = "http://curl.haxx.se/docs/"
443
444 This option can be used multiple times.
445 .IP "--limit-rate <speed>"
446 Specify the maximum transfer rate you want curl to use. This feature is useful
447 if you have a limited pipe and you'd like your transfer not use your entire
448 bandwidth.
449
450 The given speed is measured in bytes/second, unless a suffix is appended.
451 Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it
452 megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
453
454 If you are also using the \fI-Y/--speed-limit\fP option, that option will take
455 precedence and might cripple the rate-limiting slightly, to help keeping the
456 speed-limit logic working.
457
458 This option was introduced in curl 7.10.
459
460 If this option is used several times, the last one will be used.
461 .IP "-l/--list-only"
462 (FTP)
463 When listing an FTP directory, this switch forces a name-only view.
464 Especially useful if you want to machine-parse the contents of an FTP
465 directory since the normal directory view doesn't use a standard look
466 or format.
467
468 This option causes an FTP NLST command to be sent.  Some FTP servers
469 list only files in their response to NLST; they do not include
470 subdirectories and symbolic links.
471
472 If this option is used twice, the second will again disable list only.
473 .IP "-L/--location"
474 (HTTP/HTTPS) If the server reports that the requested page has a different
475 location (indicated with the header line Location:) this flag will let curl
476 attempt to reattempt the get on the new place. If used together with
477 \fI-i/--include\fP or \fI-I/--head\fP, headers from all requested pages will
478 be shown. If authentication is used, curl will only send its credentials to
479 the initial host, so if a redirect takes curl to a different host, it won't
480 intercept the user+password. See also \fI--location-trusted\fP on how to
481 change this.
482
483 If this option is used twice, the second will again disable location following.
484 .IP "--location-trusted"
485 (HTTP/HTTPS) Like \fI-L/--location\fP, but will allow sending the name +
486 password to all hosts that the site may redirect to. This may or may not
487 introduce a security breach if the site redirects you do a site to which
488 you'll send your authentication info (which is plaintext in the case of HTTP
489 Basic authentication).
490
491 If this option is used twice, the second will again disable location following.
492 .IP "--max-filesize <bytes>"
493 Specify the maximum size (in bytes) of a file to download. If the file
494 requested is larger than this value, the transfer will not start and curl will
495 return with exit code 63.
496
497 NOTE: The file size is not always known prior to download, and for such files
498 this option has no effect even if the file transfer ends up being larger than
499 this given limit. This concerns both FTP and HTTP transfers.
500 .IP "-m/--max-time <seconds>"
501 Maximum time in seconds that you allow the whole operation to take.  This is
502 useful for preventing your batch jobs from hanging for hours due to slow
503 networks or links going down.  This doesn't work fully in win32 systems.  See
504 also the \fI--connect-timeout\fP option.
505
506 If this option is used several times, the last one will be used.
507 .IP "-M/--manual"
508 Manual. Display the huge help text.
509 .IP "-n/--netrc"
510 Makes curl scan the \fI.netrc\fP file in the user's home directory for login
511 name and password. This is typically used for ftp on unix. If used with http,
512 curl will enable user authentication. See
513 .BR netrc(4)
514 or
515 .BR ftp(1)
516 for details on the file format. Curl will not complain if that file
517 hasn't the right permissions (it should not be world nor group
518 readable). The environment variable "HOME" is used to find the home
519 directory.
520
521 A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
522 to ftp to the machine host.domain.com with user name \&'myself' and password
523 'secret' should look similar to:
524
525 .B "machine host.domain.com login myself password secret"
526
527 If this option is used twice, the second will again disable netrc usage.
528 .IP "--netrc-optional"
529 Very similar to \fI--netrc\fP, but this option makes the .netrc usage
530 \fBoptional\fP and not mandatory as the \fI--netrc\fP does.
531 .IP "--negotiate"
532 (HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was
533 designed by Microsoft and is used in their web aplications. It is primarily
534 meant as a support for Kerberos5 authentication but may be also used along
535 with another authentication methods. For more information see IETF draft
536 draft-brezak-spnego-http-04.txt. (Added in 7.10.6)
537
538 This option requiures that the library was built with GSSAPI support. This is
539 not very common. Use \fI-V/--version\fP to see if your version supports
540 GSS-Negotiate.
541
542 If this option is used several times, the following occurrences make no
543 difference.
544 .IP "-N/--no-buffer"
545 Disables the buffering of the output stream. In normal work situations, curl
546 will use a standard buffered output stream that will have the effect that it
547 will output the data in chunks, not necessarily exactly when the data arrives.
548 Using this option will disable that buffering.
549
550 If this option is used twice, the second will again switch on buffering.
551 .IP "--ntlm"
552 (HTTP) Enables NTLM authentication. The NTLM authentication method was
553 designed by Microsoft and is used by IIS web servers. It is a proprietary
554 protocol, reversed engineered by clever people and implemented in curl based
555 on their efforts. This kind of behavior should not be endorsed, you should
556 encourage everyone who uses NTLM to switch to a public and documented
557 authentication method instead. Such as Digest. (Added in 7.10.6)
558
559 If you want to enable NTLM for your proxy authentication, then use
560 \fI--proxy-ntlm\fP.
561
562 This option requiures that the library was built with SSL support. Use
563 \fI-V/--version\fP to see if your curl supports NTLM.
564
565 If this option is used several times, the following occurrences make no
566 difference.
567 .IP "-o/--output <file>"
568 Write output to <file> instead of stdout. If you are using {} or [] to fetch
569 multiple documents, you can use '#' followed by a number in the <file>
570 specifier. That variable will be replaced with the current string for the URL
571 being fetched. Like in:
572
573   curl http://{one,two}.site.com -o "file_#1.txt"
574
575 or use several variables like:
576
577   curl http://{site,host}.host[1-5].com -o "#1_#2"
578
579 You may use this option as many times as you have number of URLs.
580
581 See also the \fI--create-dirs\fP option to create the local directories
582 dynamically.
583 .IP "-O/--remote-name"
584 Write output to a local file named like the remote file we get. (Only the file
585 part of the remote file is used, the path is cut off.)
586
587 You may use this option as many times as you have number of URLs.
588 .IP "--pass <phrase>"
589 (SSL) Pass phrase for the private key
590
591 If this option is used several times, the last one will be used.
592 .IP "--proxy-ntlm"
593 Tells curl to use NTLM authentication when communicating with the given
594 proxy. Use \fI--ntlm\fP for enabling NTLM with a remote host.
595
596 If this option is used twice, the second will again disable proxy NTLM.
597 .IP "-p/--proxytunnel"
598 When an HTTP proxy is used (\fI-x/--proxy\fP), this option will cause non-HTTP
599 protocols to attempt to tunnel through the proxy instead of merely using it to
600 do HTTP-like operations. The tunnel approach is made with the HTTP proxy
601 CONNECT request and requires that the proxy allows direct connect to the
602 remote port number curl wants to tunnel through to.
603
604 If this option is used twice, the second will again disable proxy tunnel.
605 .IP "-P/--ftp-port <address>"
606 (FTP) Reverses the initiator/listener roles when connecting with ftp. This
607 switch makes Curl use the PORT command instead of PASV. In practice, PORT
608 tells the server to connect to the client's specified address and port, while
609 PASV asks the server for an ip address and port to connect to. <address>
610 should be one of:
611 .RS
612 .IP interface
613 i.e "eth0" to specify which interface's IP address you want to use  (Unix only)
614 .IP "IP address"
615 i.e "192.168.10.1" to specify exact IP number
616 .IP "host name"
617 i.e "my.host.domain" to specify machine
618 .IP "-"
619 (any single-letter string) to make it pick the machine's default
620 .RE
621
622 If this option is used several times, the last one will be used. Disable the
623 use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command
624 instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
625 .IP "-q"
626 If used as the first parameter on the command line, the \fI$HOME/.curlrc\fP
627 file will not be read and used as a config file.
628 .IP "-Q/--quote <comand>"
629 (FTP) Send an arbitrary command to the remote FTP server, by using the QUOTE
630 command of the server. Not all servers support this command, and the set of
631 QUOTE commands are server specific! Quote commands are sent BEFORE the
632 transfer is taking place. To make commands take place after a successful
633 transfer, prefix them with a dash '-'. You may specify any amount of commands
634 to be run before and after the transfer. If the server returns failure for one
635 of the commands, the entire operation will be aborted.
636
637 This option can be used multiple times.
638 .IP "--random-file <file>"
639 (HTTPS) Specify the path name to file containing what will be considered as
640 random data. The data is used to seed the random engine for SSL connections.
641 See also the \fI--egd-file\fP option.
642 .IP "-r/--range <range>"
643 (HTTP/FTP)
644 Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTP
645 server. Ranges can be specified in a number of ways.
646 .RS
647 .TP 10
648 .B 0-499
649 specifies the first 500 bytes
650 .TP
651 .B 500-999
652 specifies the second 500 bytes
653 .TP
654 .B -500
655 specifies the last 500 bytes
656 .TP
657 .B 9500
658 specifies the bytes from offset 9500 and forward
659 .TP
660 .B 0-0,-1
661 specifies the first and last byte only(*)(H)
662 .TP
663 .B 500-700,600-799
664 specifies 300 bytes from offset 500(H)
665 .TP
666 .B 100-199,500-599
667 specifies two separate 100 bytes ranges(*)(H)
668 .RE
669
670 (*) = NOTE that this will cause the server to reply with a multipart
671 response!
672
673 You should also be aware that many HTTP/1.1 servers do not have this feature
674 enabled, so that when you attempt to get a range, you'll instead get the whole
675 document.
676
677 FTP range downloads only support the simple syntax 'start-stop' (optionally
678 with one of the numbers omitted). It depends on the non-RFC command SIZE.
679
680 If this option is used several times, the last one will be used.
681 .IP "-R/--remote-time"
682 When used, this will make libcurl attempt to figure out the timestamp of the
683 remote file, and if that is available make the local file get that same
684 timestamp.
685
686 If this option is used twice, the second time disables this again.
687 .IP "-s/--silent"
688 Silent mode. Don't show progress meter or error messages.  Makes
689 Curl mute.
690
691 If this option is used twice, the second will again disable mute.
692 .IP "-S/--show-error"
693 When used with -s it makes curl show error message if it fails.
694
695 If this option is used twice, the second will again disable show error.
696 .IP "--socks <host[:port]>"
697 Use the specified SOCKS5 proxy. If the port number is not specified, it is
698 assumed at port 1080. (Option added in 7.11.1)
699
700 This option overrides any previous use of \fI-x/--proxy\fP, as they are
701 mutually exclusive.
702
703 If this option is used several times, the last one will be used.
704 .IP "--stderr <file>"
705 Redirect all writes to stderr to the specified file instead. If the file name
706 is a plain '-', it is instead written to stdout. This option has no point when
707 you're using a shell with decent redirecting capabilities.
708
709 If this option is used several times, the last one will be used.
710 .IP "-t/--telnet-option <OPT=val>"
711 Pass options to the telnet protocol. Supported options are:
712
713 TTYPE=<term> Sets the terminal type.
714
715 XDISPLOC=<X display> Sets the X display location.
716
717 NEW_ENV=<var,val> Sets an environment variable.
718 .IP "-T/--upload-file <file>"
719 This transfers the specified local file to the remote URL. If there is no file
720 part in the specified URL, Curl will append the local file name. NOTE that you
721 must use a trailing / on the last directory to really prove to Curl that there
722 is no file name or curl will think that your last directory name is the remote
723 file name to use. That will most likely cause the upload operation to fail. If
724 this is used on a http(s) server, the PUT command will be used.
725
726 Use the file name "-" (a single dash) to use stdin instead of a given file.
727
728 Before 7.10.8, when this option was used several times, the last one was used.
729
730 In curl 7.10.8 and later, you can specify one -T for each URL on the command
731 line. Each -T + URL pair specifies what to upload and to where. curl also
732 supports "globbing" of the -T argument, meaning that you can upload multiple
733 files to a single URL by using the same URL globbing style supported in the
734 URL, like this:
735
736 curl -T "{file1,file2}" http://www.uploadtothissite.com
737
738 or even
739
740 curl -T "img[1-1000].png" ftp://ftp.picturemania.com/upload/
741 .IP "--trace <file>"
742 Enables a full trace dump of all incoming and outgoing data, including
743 descriptive information, to the given output file. Use "-" as filename to have
744 the output sent to stdout.
745
746 If this option is used several times, the last one will be used. (Added in
747 7.9.7)
748 .IP "--trace-ascii <file>"
749 Enables a full trace dump of all incoming and outgoing data, including
750 descriptive information, to the given output file. Use "-" as filename to have
751 the output sent to stdout.
752
753 This is very similar to \fI--trace\fP, but leaves out the hex part and only
754 shows the ASCII part of the dump. It makes smaller output that might be easier
755 to read for untrained humans.
756
757 If this option is used several times, the last one will be used. (Added in
758 7.9.7)
759 .IP "-u/--user <user:password>"
760 Specify user and password to use for server authentication.
761
762 If this option is used several times, the last one will be used.
763 .IP "-U/--proxy-user <user:password>"
764 Specify user and password to use for proxy authentication.
765
766 If this option is used several times, the last one will be used.
767 .IP "--url <URL>"
768 Specify a URL to fetch. This option is mostly handy when you want to specify
769 URL(s) in a config file.
770
771 This option may be used any number of times. To control where this URL is
772 written, use the \fI-o/--output\fP or the \fI-O/--remote-name\fP options.
773 .IP "-v/--verbose"
774 Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
775 starting with '>' means data sent by curl, '<' means data received by curl
776 that is hidden in normal cases and lines starting with '*' means additional
777 info provided by curl.
778
779 Note that if you want to see HTTP headers in the output, \fI-i/--include\fP
780 might be option you're looking for.
781
782 If you think this option still doesn't give you enough details, consider using
783 \fI--trace\fP or \fI--trace-ascii\fP instead.
784
785 If this option is used twice, the second will again disable verbose.
786 .IP "-V/--version"
787 Displays information about curl and the libcurl version it uses.
788
789 The first line includes the full version of curl, libcurl and other 3rd party
790 libraries linked with the executable.
791
792 The second line (starts with "Protocols:") shows all protocols that libcurl
793 reports to support.
794
795 The third line (starts with "Features:") shows specific features libcurl
796 reports to offer. Available features include:
797 .RS
798 .IP "IPv6"
799 You can use IPv6 with this.
800 .IP "krb4"
801 Krb4 for ftp is supported.
802 .IP "SSL"
803 HTTPS and FTPS are supported.
804 .IP "libz"
805 Automatic decompression of compressed files over HTTP is supported.
806 .IP "NTLM"
807 NTLM authenticaion is supported.
808 .IP "GSS-Negotiate"
809 Negotiate authenticaion is supported.
810 .IP "Debug"
811 This curl uses a libcurl built with Debug. This enables more error-tracking
812 and memory debugging etc. For curl-developers only!
813 .IP "AsynchDNS"
814 This curl uses asynchronous name resolves.
815 .IP "SPNEGO"
816 SPNEGO Negotiate authenticaion is supported.
817 .IP "Largefile"
818 This curl supports transfers of large files, files larger than 2GB.
819 .RE
820 .IP "-w/--write-out <format>"
821 Defines what to display after a completed and successful operation. The format
822 is a string that may contain plain text mixed with any number of variables. The
823 string can be specified as "string", to get read from a particular file you
824 specify it "@filename" and to tell curl to read the format from stdin you
825 write "@-".
826
827 The variables present in the output format will be substituted by the value or
828 text that curl thinks fit, as described below. All variables are specified
829 like %{variable_name} and to output a normal % you just write them like
830 %%. You can output a newline by using \\n, a carriage return with \\r and a tab
831 space with \\t.
832
833 .B NOTE:
834 The %-letter is a special letter in the win32-environment, where all
835 occurrences of % must be doubled when using this option.
836
837 Available variables are at this point:
838 .RS
839 .TP 15
840 .B url_effective
841 The URL that was fetched last. This is mostly meaningful if you've told curl
842 to follow location: headers.
843 .TP
844 .B http_code
845 The numerical code that was found in the last retrieved HTTP(S) page.
846 .TP
847 .B time_total
848 The total time, in seconds, that the full operation lasted. The time will be
849 displayed with millisecond resolution.
850 .TP
851 .B time_namelookup
852 The time, in seconds, it took from the start until the name resolving was
853 completed.
854 .TP
855 .B time_connect
856 The time, in seconds, it took from the start until the connect to the remote
857 host (or proxy) was completed.
858 .TP
859 .B time_pretransfer
860 The time, in seconds, it took from the start until the file transfer is just
861 about to begin. This includes all pre-transfer commands and negotiations that
862 are specific to the particular protocol(s) involved.
863 .TP
864 .B time_starttransfer
865 The time, in seconds, it took from the start until the first byte is just about
866 to be transfered. This includes time_pretransfer and also the time the
867 server needs to calculate the result.
868 .TP
869 .B size_download
870 The total amount of bytes that were downloaded.
871 .TP
872 .B size_upload
873 The total amount of bytes that were uploaded.
874 .TP
875 .B size_header
876 The total amount of bytes of the downloaded headers.
877 .TP
878 .B size_request
879 The total amount of bytes that were sent in the HTTP request.
880 .TP
881 .B speed_download
882 The average download speed that curl measured for the complete download.
883 .TP
884 .B speed_upload
885 The average upload speed that curl measured for the complete upload.
886 .TP
887 .B content_type
888 The Content-Type of the requested document, if there was any. (Added in 7.9.5)
889 .RE
890
891 If this option is used several times, the last one will be used.
892 .IP "-x/--proxy <proxyhost[:port]>"
893 Use specified HTTP proxy. If the port number is not specified, it is assumed
894 at port 1080.
895
896 This option overrides existing environment variables that sets proxy to
897 use. If there's an environment variable setting a proxy, you can set proxy to
898 \&"" to override it.
899
900 \fBNote\fP that all operations that are performed over a HTTP proxy will
901 transparantly be converted to HTTP. It means that certain protocol specific
902 operations might not be available. This is not the case if you can tunnel
903 through the proxy, as done with the \fI-p/--proxytunnel\fP option.
904
905 If this option is used several times, the last one will be used.
906 .IP "-X/--request <command>"
907 (HTTP)
908 Specifies a custom request to use when communicating with the HTTP server.
909 The specified request will be used instead of the standard GET. Read the
910 HTTP 1.1 specification for details and explanations.
911
912 (FTP)
913 Specifies a custom FTP command to use instead of LIST when doing file lists
914 with ftp.
915
916 If this option is used several times, the last one will be used.
917 .IP "-y/--speed-time <time>"
918 If a download is slower than speed-limit bytes per second during a speed-time
919 period, the download gets aborted. If speed-time is used, the default
920 speed-limit will be 1 unless set with -y.
921
922 This option controls transfers and thus will not affect slow connects etc. If
923 this is a concern for you, try the \fI--connect-timeout\fP option.
924
925 If this option is used several times, the last one will be used.
926 .IP "-Y/--speed-limit <speed>"
927 If a download is slower than this given speed, in bytes per second, for
928 speed-time seconds it gets aborted. speed-time is set with -Y and is 30 if
929 not set.
930
931 If this option is used several times, the last one will be used.
932 .IP "-z/--time-cond <date expression>"
933 (HTTP)
934 Request to get a file that has been modified later than the given time and
935 date, or one that has been modified before that time. The date expression can
936 be all sorts of date strings or if it doesn't match any internal ones, it
937 tries to get the time from a given file name instead! See the
938 .BR "GNU date(1)"
939 or
940 .BR "curl_getdate(3)"
941 man pages for date expression details.
942
943 Start the date expression with a dash (-) to make it request for a document
944 that is older than the given date/time, default is a document that is newer
945 than the specified date/time.
946
947 If this option is used several times, the last one will be used.
948 .IP "-Z/--max-redirs <num>"
949 Set maximum number of redirection-followings allowed. If \fI-L/--location\fP
950 is used, this option can be used to prevent curl from following redirections
951 \&"in absurdum".
952
953 If this option is used several times, the last one will be used.
954 .IP "-0/--http1.0"
955 (HTTP) Forces curl to issue its requests using HTTP 1.0 instead of using its
956 internally preferred: HTTP 1.1.
957 .IP "-1/--tlsv1"
958 (HTTPS)
959 Forces curl to use TSL version 1 when negotiating with a remote TLS server.
960 .IP "-2/--sslv2"
961 (HTTPS)
962 Forces curl to use SSL version 2 when negotiating with a remote SSL server.
963 .IP "-3/--sslv3"
964 (HTTPS)
965 Forces curl to use SSL version 3 when negotiating with a remote SSL server.
966 .IP "-4/--ipv4"
967 If libcurl is capable of resolving an address to multiple IP versions (which
968 it is if it is ipv6-capable), this option tells libcurl to resolve names to
969 IPv4 addresses only. (Added in 7.10.8)
970 .IP "-6/--ipv6"
971 If libcurl is capable of resolving an address to multiple IP versions (which
972 it is if it is ipv6-capable), this option tells libcurl to resolve names to
973 IPv6 addresses only. (Added in 7.10.8)
974 .IP "-#/--progress-bar"
975 Make curl display progress information as a progress bar instead of the
976 default statistics.
977
978 If this option is used twice, the second will again disable the progress bar.
979 .SH FILES
980 .I ~/.curlrc
981 .RS
982 Default config file.
983
984 .SH ENVIRONMENT
985 .IP "http_proxy [protocol://]<host>[:port]"
986 Sets proxy server to use for HTTP.
987 .IP "HTTPS_PROXY [protocol://]<host>[:port]"
988 Sets proxy server to use for HTTPS.
989 .IP "FTP_PROXY [protocol://]<host>[:port]"
990 Sets proxy server to use for FTP.
991 .IP "GOPHER_PROXY [protocol://]<host>[:port]"
992 Sets proxy server to use for GOPHER.
993 .IP "ALL_PROXY [protocol://]<host>[:port]"
994 Sets proxy server to use if no protocol-specific proxy is set.
995 .IP "NO_PROXY <comma-separated list of hosts>"
996 list of host names that shouldn't go through any proxy. If set to a asterisk
997 '*' only, it matches all hosts.
998 .SH EXIT CODES
999 There exists a bunch of different error codes and their corresponding error
1000 messages that may appear during bad conditions. At the time of this writing,
1001 the exit codes are:
1002 .IP 1
1003 Unsupported protocol. This build of curl has no support for this protocol.
1004 .IP 2
1005 Failed to initialize.
1006 .IP 3
1007 URL malformat. The syntax was not correct.
1008 .IP 4
1009 URL user malformatted. The user-part of the URL syntax was not correct.
1010 .IP 5
1011 Couldn't resolve proxy. The given proxy host could not be resolved.
1012 .IP 6
1013 Couldn't resolve host. The given remote host was not resolved.
1014 .IP 7
1015 Failed to connect to host.
1016 .IP 8
1017 FTP weird server reply. The server sent data curl couldn't parse.
1018 .IP 9
1019 FTP access denied. The server denied login.
1020 .IP 10
1021 FTP user/password incorrect. Either one or both were not accepted by the
1022 server.
1023 .IP 11
1024 FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request.
1025 .IP 12
1026 FTP weird USER reply. Curl couldn't parse the reply sent to the USER request.
1027 .IP 13
1028 FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request.
1029 .IP 14
1030 FTP weird 227 format. Curl couldn't parse the 227-line the server sent.
1031 .IP 15
1032 FTP can't get host. Couldn't resolve the host IP we got in the 227-line.
1033 .IP 16
1034 FTP can't reconnect. Couldn't connect to the host we got in the 227-line.
1035 .IP 17
1036 FTP couldn't set binary. Couldn't change transfer method to binary.
1037 .IP 18
1038 Partial file. Only a part of the file was transfered.
1039 .IP 19
1040 FTP couldn't download/access the given file, the RETR (or similar) command
1041 failed.
1042 .IP 20
1043 FTP write error. The transfer was reported bad by the server.
1044 .IP 21
1045 FTP quote error. A quote command returned error from the server.
1046 .IP 22
1047 HTTP page not retrieved. The requested url was not found or returned another
1048 error with the HTTP error code being 400 or above. This return code only
1049 appears if \fI-f/--fail\fP is used.
1050 .IP 23
1051 Write error. Curl couldn't write data to a local filesystem or similar.
1052 .IP 24
1053 Malformed user. User name badly specified.
1054 .IP 25
1055 FTP couldn't STOR file. The server denied the STOR operation, used for FTP
1056 uploading.
1057 .IP 26
1058 Read error. Various reading problems.
1059 .IP 27
1060 Out of memory. A memory allocation request failed.
1061 .IP 28
1062 Operation timeout. The specified time-out period was reached according to the
1063 conditions.
1064 .IP 29
1065 FTP couldn't set ASCII. The server returned an unknown reply.
1066 .IP 30
1067 FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT
1068 command, try doing a transfer using PASV instead!
1069 .IP 31
1070 FTP couldn't use REST. The REST command failed. This command is used for
1071 resumed FTP transfers.
1072 .IP 32
1073 FTP couldn't use SIZE. The SIZE command failed. The command is an extension
1074 to the original FTP spec RFC 959.
1075 .IP 33
1076 HTTP range error. The range "command" didn't work.
1077 .IP 34
1078 HTTP post error. Internal post-request generation error.
1079 .IP 35
1080 SSL connect error. The SSL handshaking failed.
1081 .IP 36
1082 FTP bad download resume. Couldn't continue an earlier aborted download.
1083 .IP 37
1084 FILE couldn't read file. Failed to open the file. Permissions?
1085 .IP 38
1086 LDAP cannot bind. LDAP bind operation failed.
1087 .IP 39
1088 LDAP search failed.
1089 .IP 40
1090 Library not found. The LDAP library was not found.
1091 .IP 41
1092 Function not found. A required LDAP function was not found.
1093 .IP 42
1094 Aborted by callback. An application told curl to abort the operation.
1095 .IP 43
1096 Internal error. A function was called with a bad parameter.
1097 .IP 44
1098 Internal error. A function was called in a bad order.
1099 .IP 45
1100 Interface error. A specified outgoing interface could not be used.
1101 .IP 46
1102 Bad password entered. An error was signaled when the password was entered.
1103 .IP 47
1104 Too many redirects. When following redirects, curl hit the maximum amount.
1105 .IP 48
1106 Unknown TELNET option specified.
1107 .IP 49
1108 Malformed telnet option.
1109 .IP 51
1110 The remote peer's SSL certificate wasn't ok
1111 .IP 52
1112 The server didn't reply anything, which here is considered an error.
1113 .IP 53
1114 SSL crypto engine not found
1115 .IP 54
1116 Cannot set SSL crypto engine as default
1117 .IP 55
1118 Failed sending network data
1119 .IP 56
1120 Failure in receiving network data
1121 .IP 57
1122 Share is in use (internal error)
1123 .IP 58
1124 Problem with the local certificate
1125 .IP 59
1126 Couldn't use specified SSL cipher
1127 .IP 60
1128 Problem with the CA cert (path? permission?)
1129 .IP 61
1130 Unrecognized transfer encoding
1131 .IP 62
1132 Invalid LDAP URL
1133 .IP 63
1134 Maximum file size exceeded
1135 .IP XX
1136 There will appear more error codes here in future releases. The existing ones
1137 are meant to never change.
1138 .SH AUTHORS / CONTRIBUTORS
1139 Daniel Stenberg is the main author, but the whole list of contributors is
1140 found in the separate THANKS file.
1141 .SH WWW
1142 http://curl.haxx.se
1143 .SH FTP
1144 ftp://ftp.sunet.se/pub/www/utilities/curl/
1145 .SH "SEE ALSO"
1146 .BR ftp (1),
1147 .BR wget (1),
1148 .BR snarf (1)