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