blob: 13add74b2565035b4487458fdb1d0d1fb5a62017 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001.\" **************************************************************************
2.\" * _ _ ____ _
3.\" * Project ___| | | | _ \| |
4.\" * / __| | | | |_) | |
5.\" * | (__| |_| | _ <| |___
6.\" * \___|\___/|_| \_\_____|
7.\" *
8.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
9.\" *
10.\" * This software is licensed as described in the file COPYING, which
11.\" * you should have received as part of this distribution. The terms
12.\" * are also available at https://curl.haxx.se/docs/copyright.html.
13.\" *
14.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15.\" * copies of the Software, and permit persons to whom the Software is
16.\" * furnished to do so, under the terms of the COPYING file.
17.\" *
18.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19.\" * KIND, either express or implied.
20.\" *
21.\" **************************************************************************
22.\"
23.\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
24.\"
25.TH curl 1 "November 16, 2016" "Curl 7.54.1" "Curl Manual"
26
27.SH NAME
28curl \- transfer a URL
29.SH SYNOPSIS
30.B curl [options]
31.I [URL...]
32.SH DESCRIPTION
33.B curl
34is a tool to transfer data from or to a server, using one of the supported
35protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,
36LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET
37and TFTP). The command is designed to work without user interaction.
38
39curl offers a busload of useful tricks like proxy support, user
40authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
41resume, Metalink, and more. As you will see below, the number of features will
42make your head spin!
43
44curl is powered by libcurl for all transfer-related features. See
45\fIlibcurl(3)\fP for details.
46.SH URL
47The URL syntax is protocol-dependent. You'll find a detailed description in
48RFC 3986.
49
50You can specify multiple URLs or parts of URLs by writing part sets within
51braces as in:
52
53 http://site.{one,two,three}.com
54
55or you can get sequences of alphanumeric series by using [] as in:
56
57 ftp://ftp.example.com/file[1-100].txt
58
59 ftp://ftp.example.com/file[001-100].txt (with leading zeros)
60
61 ftp://ftp.example.com/file[a-z].txt
62
63Nested sequences are not supported, but you can use several ones next to each
64other:
65
66 http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html
67
68You can specify any amount of URLs on the command line. They will be fetched
69in a sequential manner in the specified order.
70
71You can specify a step counter for the ranges to get every Nth number or
72letter:
73
74 http://example.com/file[1-100:10].txt
75
76 http://example.com/file[a-z:2].txt
77
78When using [] or {} sequences when invoked from a command line prompt, you
79probably have to put the full URL within double quotes to avoid the shell from
80interfering with it. This also goes for other characters treated special, like
81for example '&', '?' and '*'.
82
83Provide the IPv6 zone index in the URL with an escaped percentage sign and the
84interface name. Like in
85
86 http://[fe80::3%25eth0]/
87
88If you specify URL without protocol:// prefix, curl will attempt to guess what
89protocol you might want. It will then default to HTTP but try other protocols
90based on often-used host name prefixes. For example, for host names starting
91with "ftp." curl will assume you want to speak FTP.
92
93curl will do its best to use what you pass to it as a URL. It is not trying to
94validate it as a syntactically correct URL by any means but is instead
95\fBvery\fP liberal with what it accepts.
96
97curl will attempt to re-use connections for multiple file transfers, so that
98getting many files from the same server will not do multiple connects /
99handshakes. This improves speed. Of course this is only done on files
100specified on a single command line and cannot be used between separate curl
101invokes.
102.SH "PROGRESS METER"
103curl normally displays a progress meter during operations, indicating the
104amount of transferred data, transfer speeds and estimated time left, etc. The
105progress meter displays number of bytes and the speeds are in bytes per
106second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024
107bytes. 1M is 1048576 bytes.
108
109curl displays this data to the terminal by default, so if you invoke curl to
110do an operation and it is about to write data to the terminal, it
111\fIdisables\fP the progress meter as otherwise it would mess up the output
112mixing progress meter and response data.
113
114If you want a progress meter for HTTP POST or PUT requests, you need to
115redirect the response output to a file, using shell redirect (>), \fI-o, --output\fP or
116similar.
117
118It is not the same case for FTP upload as that operation does not spit out
119any response data to the terminal.
120
121If you prefer a progress "bar" instead of the regular meter, \fI-#, --progress-bar\fP is
122your friend. You can also disable the progress meter completely with the
123\fI-s, --silent\fP option.
124.SH OPTIONS
125Options start with one or two dashes. Many of the options require an
126additional value next to them.
127
128The short "single-dash" form of the options, -d for example, may be used with
129or without a space between it and its value, although a space is a recommended
130separator. The long "double-dash" form, \fI-d, --data\fP for example, requires a space
131between it and its value.
132
133Short version options that don't need any additional values can be used
134immediately next to each other, like for example you can specify all the
135options -O, -L and -v at once as -OLv.
136
137In general, all boolean options are enabled with --\fBoption\fP and yet again
138disabled with --\fBno-\fPoption. That is, you use the exact same option name
139but prefix it with "no-". However, in this list we mostly only list and show
140the --option version of them. (This concept with --no options was added in
1417.19.0. Previously most options were toggled on/off on repeated use of the
142same command line option.)
143.IP "--abstract-unix-socket <path>"
144(HTTP) Connect through an abstract Unix domain socket, instead of using the network.
145Note: netstat shows the path of an abstract socket prefixed with '@', however
146the <path> argument should not have this leading character.
147
148Added in 7.53.0.
149.IP "--anyauth"
150(HTTP) Tells curl to figure out authentication method by itself, and use the most
151secure one the remote site claims to support. This is done by first doing a
152request and checking the response-headers, thus possibly inducing an extra
153network round-trip. This is used instead of setting a specific authentication
154method, which you can do with \fI--basic\fP, \fI--digest\fP, \fI--ntlm\fP, and \fI--negotiate\fP.
155
156Using \fI--anyauth\fP is not recommended if you do uploads from stdin, since it may
157require data to be sent twice and then the client must be able to rewind. If
158the need should arise when uploading from stdin, the upload operation will
159fail.
160
161Used together with \fI-u, --user\fP.
162
163See also \fI--proxy-anyauth\fP and \fI--basic\fP and \fI--digest\fP.
164.IP "-a, --append"
165(FTP SFTP) When used in an upload, this makes curl append to the target file instead of
166overwriting it. If the remote file doesn't exist, it will be created. Note
167that this flag is ignored by some SFTP servers (including OpenSSH).
168.IP "--basic"
169(HTTP) Tells curl to use HTTP Basic authentication with the remote host. This is the
170default and this option is usually pointless, unless you use it to override a
171previously set option that sets a different authentication method (such as
172\fI--ntlm\fP, \fI--digest\fP, or \fI--negotiate\fP).
173
174Used together with \fI-u, --user\fP.
175
176See also \fI--proxy-basic\fP.
177.IP "--cacert <CA certificate>"
178(TLS) Tells curl to use the specified certificate file to verify the peer. The file
179may contain multiple CA certificates. The certificate(s) must be in PEM
180format. Normally curl is built to use a default file for this, so this option
181is typically used to alter that default file.
182
183curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is
184set, and uses the given path as a path to a CA cert bundle. This option
185overrides that variable.
186
187The windows version of curl will automatically look for a CA certs file named
188\'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in the
189Current Working Directory, or in any folder along your PATH.
190
191If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
192(libnsspem.so) needs to be available for this option to work properly.
193
194(iOS and macOS only) If curl is built against Secure Transport, then this
195option is supported for backward compatibility with other SSL engines, but it
196should not be set. If the option is not set, then curl will use the
197certificates in the system and user Keychain to verify the peer, which is the
198preferred method of verifying the peer's certificate chain.
199
200If this option is used several times, the last one will be used.
201.IP "--capath <dir>"
202(TLS) Tells curl to use the specified certificate directory to verify the
203peer. Multiple paths can be provided by separating them with ":" (e.g.
204\&"path1:path2:path3"). The certificates must be in PEM format, and if curl is
205built against OpenSSL, the directory must have been processed using the
206c_rehash utility supplied with OpenSSL. Using \fI--capath\fP can allow
207OpenSSL-powered curl to make SSL-connections much more efficiently than using
208\fI--cacert\fP if the --cacert file contains many CA certificates.
209
210If this option is set, the default capath value will be ignored, and if it is
211used several times, the last one will be used.
212.IP "--cert-status"
213(TLS) Tells curl to verify the status of the server certificate by using the
214Certificate Status Request (aka. OCSP stapling) TLS extension.
215
216If this option is enabled and the server sends an invalid (e.g. expired)
217response, if the response suggests that the server certificate has been revoked,
218or no response at all is received, the verification fails.
219
220This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.
221
222Added in 7.41.0.
223.IP "--cert-type <type>"
224(TLS) Tells curl what certificate type the provided certificate is in. PEM, DER and
225ENG are recognized types. If not specified, PEM is assumed.
226
227If this option is used several times, the last one will be used.
228
229See also \fI-E, --cert\fP and \fI--key\fP and \fI--key-type\fP.
230.IP "-E, --cert <certificate[:password]>"
231(TLS) Tells curl to use the specified client certificate file when getting a file
232with HTTPS, FTPS or another SSL-based protocol. The certificate must be in
233PKCS#12 format if using Secure Transport, or PEM format if using any other
234engine. If the optional password isn't specified, it will be queried for on
235the terminal. Note that this option assumes a \&"certificate" file that is the
236private key and the client certificate concatenated! See \fI-E, --cert\fP and \fI--key\fP to
237specify them independently.
238
239If curl is built against the NSS SSL library then this option can tell
240curl the nickname of the certificate to use within the NSS database defined
241by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the
242NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be
243loaded. If you want to use a file from the current directory, please precede
244it with "./" prefix, in order to avoid confusion with a nickname. If the
245nickname contains ":", it needs to be preceded by "\\" so that it is not
246recognized as password delimiter. If the nickname contains "\\", it needs to
247be escaped as "\\\\" so that it is not recognized as an escape character.
248
249(iOS and macOS only) If curl is built against Secure Transport, then the
250certificate string can either be the name of a certificate/private key in the
251system or user keychain, or the path to a PKCS#12-encoded certificate and
252private key. If you want to use a file from the current directory, please
253precede it with "./" prefix, in order to avoid confusion with a nickname.
254
255If this option is used several times, the last one will be used.
256
257See also \fI--cert-type\fP and \fI--key\fP and \fI--key-type\fP.
258.IP "--ciphers <list of ciphers>"
259(TLS) Specifies which ciphers to use in the connection. The list of ciphers must
260specify valid ciphers. Read up on SSL cipher list details on this URL:
261
262 https://curl.haxx.se/docs/ssl-ciphers.html
263
264If this option is used several times, the last one will be used.
265.IP "--compressed"
266(HTTP) Request a compressed response using one of the algorithms curl supports, and
267save the uncompressed document. If this option is used and the server sends
268an unsupported encoding, curl will report an error.
269.IP "-K, --config <file>"
270
271Specify a text file to read curl arguments from. The command line arguments
272found in the text file will be used as if they were provided on the command
273line.
274
275Options and their parameters must be specified on the same line in the file,
276separated by whitespace, colon, or the equals sign. Long option names can
277optionally be given in the config file without the initial double dashes and
278if so, the colon or equals characters can be used as separators. If the option
279is specified with one or two dashes, there can be no colon or equals character
280between the option and its parameter.
281
282If the parameter is to contain whitespace, the parameter must be enclosed
283within quotes. Within double quotes, the following escape sequences are
284available: \\\\, \\", \\t, \\n, \\r and \\v. A backslash preceding any other
285letter is ignored. If the first column of a config line is a '#' character,
286the rest of the line will be treated as a comment. Only write one option per
287physical line in the config file.
288
289Specify the filename to \fI-K, --config\fP as '-' to make curl read the file from stdin.
290
291Note that to be able to specify a URL in the config file, you need to specify
292it using the \fI--url\fP option, and not by simply writing the URL on its own
293line. So, it could look similar to this:
294
295url = "https://curl.haxx.se/docs/"
296
297When curl is invoked, it (unless \fI-q, --disable\fP is used) checks for a default
298config file and uses it if found. The default config file is checked for in
299the following places in this order:
300
3011) curl tries to find the "home dir": It first checks for the CURL_HOME and
302then the HOME environment variables. Failing that, it uses getpwuid() on
303Unix-like systems (which returns the home dir given the current user in your
304system). On Windows, it then checks for the APPDATA variable, or as a last
305resort the '%USERPROFILE%\\Application Data'.
306
3072) On windows, if there is no _curlrc file in the home dir, it checks for one
308in the same dir the curl executable is placed. On Unix-like systems, it will
309simply try to load .curlrc from the determined home dir.
310
311.nf
312# --- Example file ---
313# this is a comment
314url = "example.com"
315output = "curlhere.html"
316user-agent = "superagent/1.0"
317
318# and fetch another URL too
319url = "example.com/docs/manpage.html"
320-O
321referer = "http://nowhereatall.example.com/"
322# --- End of example file ---
323.fi
324
325This option can be used multiple times to load multiple config files.
326.IP "--connect-timeout <seconds>"
327Maximum time in seconds that you allow curl's connection to take. This only
328limits the connection phase, so if curl connects within the given period it
329will continue - if not it will exit. Since version 7.32.0, this option
330accepts decimal values.
331
332If this option is used several times, the last one will be used.
333
334See also \fI-m, --max-time\fP.
335.IP "--connect-to <HOST1:PORT1:HOST2:PORT2>"
336
337For a request to the given HOST:PORT pair, connect to
338CONNECT-TO-HOST:CONNECT-TO-PORT instead. This option is suitable to direct
339requests at a specific server, e.g. at a specific cluster node in a cluster of
340servers. This option is only used to establish the network connection. It
341does NOT affect the hostname/port that is used for TLS/SSL (e.g. SNI,
342certificate verification) or for the application protocols. "host" and "port"
343may be the empty string, meaning "any host/port". "connect-to-host" and
344"connect-to-port" may also be the empty string, meaning "use the request's
345original host/port".
346
347This option can be used many times to add many connect rules.
348
349See also \fI--resolve\fP and \fI-H, --header\fP. Added in 7.49.0.
350.IP "-C, --continue-at <offset>"
351Continue/Resume a previous file transfer at the given offset. The given offset
352is the exact number of bytes that will be skipped, counting from the beginning
353of the source file before it is transferred to the destination. If used with
354uploads, the FTP server command SIZE will not be used by curl.
355
356Use "-C -" to tell curl to automatically find out where/how to resume the
357transfer. It then uses the given output/input files to figure that out.
358
359If this option is used several times, the last one will be used.
360
361See also \fI-r, --range\fP.
362.IP "-c, --cookie-jar <filename>"
363(HTTP) Specify to which file you want curl to write all cookies after a completed
364operation. Curl writes all cookies from its in-memory cookie storage to the
365given file at the end of operations. If no cookies are known, no data will be
366written. The file will be written using the Netscape cookie file format. If
367you set the file name to a single dash, "-", the cookies will be written to
368stdout.
369
370This command line option will activate the cookie engine that makes curl
371record and use cookies. Another way to activate it is to use the \fI-b, --cookie\fP
372option.
373
374If the cookie jar can't be created or written to, the whole curl operation
375won't fail or even report an error clearly. Using \fI-v, --verbose\fP will get a warning
376displayed, but that is the only visible feedback you get about this possibly
377lethal situation.
378
379If this option is used several times, the last specified file name will be
380used.
381.IP "-b, --cookie <data>"
382(HTTP) Pass the data to the HTTP server in the Cookie header. It is supposedly
383the data previously received from the server in a "Set-Cookie:" line. The
384data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
385
386If no '=' symbol is used in the argument, it is instead treated as a filename
387to read previously stored cookie from. This option also activates the cookie
388engine which will make curl record incoming cookies, which may be handy if
389you're using this in combination with the \fI-L, --location\fP option or do multiple URL
390transfers on the same invoke.
391
392The file format of the file to read cookies from should be plain HTTP headers
393(Set-Cookie style) or the Netscape/Mozilla cookie file format.
394
395The file specified with \fI-b, --cookie\fP is only used as input. No cookies will be
396written to the file. To store cookies, use the \fI-c, --cookie-jar\fP option.
397
398Exercise caution if you are using this option and multiple transfers may
399occur. If you use the NAME1=VALUE1; format, or in a file use the Set-Cookie
400format and don't specify a domain, then the cookie is sent for any domain
401(even after redirects are followed) and cannot be modified by a server-set
402cookie. If the cookie engine is enabled and a server sets a cookie of the same
403name then both will be sent on a future transfer to that server, likely not
404what you intended. To address these issues set a domain in Set-Cookie (doing
405that will include sub domains) or use the Netscape format.
406
407If this option is used several times, the last one will be used.
408
409Users very often want to both read cookies from a file and write updated
410cookies back to a file, so using both \fI-b, --cookie\fP and \fI-c, --cookie-jar\fP in the same
411command line is common.
412.IP "--create-dirs"
413When used in conjunction with the \fI-o, --output\fP option, curl will create the
414necessary local directory hierarchy as needed. This option creates the dirs
415mentioned with the \fI-o, --output\fP option, nothing else. If the --output file name
416uses no dir or if the dirs it mentions already exist, no dir will be created.
417
418To create remote directories when using FTP or SFTP, try \fI--ftp-create-dirs\fP.
419.IP "--crlf"
420(FTP SMTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
421
422(SMTP added in 7.40.0)
423.IP "--crlfile <file>"
424(TLS) Provide a file using PEM format with a Certificate Revocation List that may
425specify peer certificates that are to be considered revoked.
426
427If this option is used several times, the last one will be used.
428
429Added in 7.19.7.
430.IP "--data-ascii <data>"
431(HTTP) This is just an alias for \fI-d, --data\fP.
432.IP "--data-binary <data>"
433(HTTP) This posts data exactly as specified with no extra processing whatsoever.
434
435If you start the data with the letter @, the rest should be a filename. Data
436is posted in a similar manner as \fI-d, --data\fP does, except that newlines and
437carriage returns are preserved and conversions are never done.
438
439If this option is used several times, the ones following the first will append
440data as described in \fI-d, --data\fP.
441.IP "--data-raw <data>"
442(HTTP) This posts data similarly to \fI-d, --data\fP but without the special
443interpretation of the @ character.
444
445See also \fI-d, --data\fP. Added in 7.43.0.
446.IP "--data-urlencode <data>"
447(HTTP) This posts data, similar to the other \fI-d, --data\fP options with the exception
448that this performs URL-encoding.
449
450To be CGI-compliant, the <data> part should begin with a \fIname\fP followed
451by a separator and a content specification. The <data> part can be passed to
452curl using one of the following syntaxes:
453.RS
454.IP "content"
455This will make curl URL-encode the content and pass that on. Just be careful
456so that the content doesn't contain any = or @ symbols, as that will then make
457the syntax match one of the other cases below!
458.IP "=content"
459This will make curl URL-encode the content and pass that on. The preceding =
460symbol is not included in the data.
461.IP "name=content"
462This will make curl URL-encode the content part and pass that on. Note that
463the name part is expected to be URL-encoded already.
464.IP "@filename"
465This will make curl load data from the given file (including any newlines),
466URL-encode that data and pass it on in the POST.
467.IP "name@filename"
468This will make curl load data from the given file (including any newlines),
469URL-encode that data and pass it on in the POST. The name part gets an equal
470sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
471name is expected to be URL-encoded already.
472.RE
473
474See also \fI-d, --data\fP and \fI--data-raw\fP. Added in 7.18.0.
475.IP "-d, --data <data>"
476(HTTP) Sends the specified data in a POST request to the HTTP server, in the same way
477that a browser does when a user has filled in an HTML form and presses the
478submit button. This will cause curl to pass the data to the server using the
479content-type application/x-www-form-urlencoded. Compare to \fI-F, --form\fP.
480
481\fI--data-raw\fP is almost the same but does not have a special interpretation of
482the @ character. To post data purely binary, you should instead use the
483\fI--data-binary\fP option. To URL-encode the value of a form field you may use
484\fI--data-urlencode\fP.
485
486If any of these options is used more than once on the same command line, the
487data pieces specified will be merged together with a separating
488&-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post
489chunk that looks like \&'name=daniel&skill=lousy'.
490
491If you start the data with the letter @, the rest should be a file name to
492read the data from, or - if you want curl to read the data from
493stdin. Multiple files can also be specified. Posting data from a file named
494'foobar' would thus be done with \fI-d, --data\fP @foobar. When --data is told to read
495from a file like that, carriage returns and newlines will be stripped out. If
496you don't want the @ character to have a special interpretation use \fI--data-raw\fP
497instead.
498
499See also \fI--data-binary\fP and \fI--data-urlencode\fP and \fI--data-raw\fP. This option overrides \fI-F, --form\fP and \fI-I, --head\fP and \fI--upload\fP.
500.IP "--delegation <LEVEL>"
501(GSS/kerberos) Set LEVEL to tell the server what it is allowed to delegate when it
502comes to user credentials.
503.RS
504.IP "none"
505Don't allow any delegation.
506.IP "policy"
507Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos
508service ticket, which is a matter of realm policy.
509.IP "always"
510Unconditionally allow the server to delegate.
511.RE
512.IP "--digest"
513(HTTP) Enables HTTP Digest authentication. This is an authentication scheme that
514prevents the password from being sent over the wire in clear text. Use this in
515combination with the normal \fI-u, --user\fP option to set user name and password.
516
517If this option is used several times, only the first one is used.
518
519See also \fI-u, --user\fP and \fI--proxy-digest\fP and \fI--anyauth\fP. This option overrides \fI--basic\fP and \fI--ntlm\fP and \fI--negotiate\fP.
520.IP "--disable-eprt"
521(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active
522FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT
523before using PORT, but with this option, it will use PORT right away. EPRT and
524LPRT are extensions to the original FTP protocol, and may not work on all
525servers, but they enable more functionality in a better way than the
526traditional PORT command.
527
528--eprt can be used to explicitly enable EPRT again and --no-eprt is an alias
529for \fI--disable-eprt\fP.
530
531If the server is accessed using IPv6, this option will have no effect as EPRT
532is necessary then.
533
534Disabling EPRT only changes the active behavior. If you want to switch to
535passive mode you need to not use \fI-P, --ftp-port\fP or force it with \fI--ftp-pasv\fP.
536.IP "--disable-epsv"
537(FTP) (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP
538transfers. Curl will normally always first attempt to use EPSV before PASV,
539but with this option, it will not try using EPSV.
540
541--epsv can be used to explicitly enable EPSV again and --no-epsv is an alias
542for \fI--disable-epsv\fP.
543
544If the server is an IPv6 host, this option will have no effect as EPSV is
545necessary then.
546
547Disabling EPSV only changes the passive behavior. If you want to switch to
548active mode you need to use \fI-P, --ftp-port\fP.
549.IP "-q, --disable"
550If used as the first parameter on the command line, the \fIcurlrc\fP config
551file will not be read and used. See the \fI-K, --config\fP for details on the default
552config file search path.
553.IP "--dns-interface <interface>"
554(DNS) Tell curl to send outgoing DNS requests through <interface>. This option is a
555counterpart to \fI--interface\fP (which does not affect DNS). The supplied string
556must be an interface name (not an address).
557
558See also \fI--dns-ipv4-addr\fP and \fI--dns-ipv6-addr\fP. \fI--dns-interface\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
559.IP "--dns-ipv4-addr <address>"
560(DNS) Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that
561the DNS requests originate from this address. The argument should be a
562single IPv4 address.
563
564See also \fI--dns-interface\fP and \fI--dns-ipv6-addr\fP. \fI--dns-ipv4-addr\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
565.IP "--dns-ipv6-addr <address>"
566(DNS) Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that
567the DNS requests originate from this address. The argument should be a
568single IPv6 address.
569
570See also \fI--dns-interface\fP and \fI--dns-ipv4-addr\fP. \fI--dns-ipv6-addr\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
571.IP "--dns-servers <addresses>"
572Set the list of DNS servers to be used instead of the system default.
573The list of IP addresses should be separated with commas. Port numbers
574may also optionally be given as \fI:<port-number>\fP after each IP
575address.
576
577\fI--dns-servers\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
578.IP "-D, --dump-header <filename>"
579(HTTP FTP) Write the received protocol headers to the specified file.
580
581This option is handy to use when you want to store the headers that an HTTP
582site sends to you. Cookies from the headers could then be read in a second
583curl invocation by using the \fI-b, --cookie\fP option! The \fI-c, --cookie-jar\fP option is a
584better way to store cookies.
585
586When used in FTP, the FTP server response lines are considered being "headers"
587and thus are saved there.
588
589If this option is used several times, the last one will be used.
590
591See also \fI-o, --output\fP.
592.IP "--egd-file <file>"
593(TLS) Specify the path name to the Entropy Gathering Daemon socket. The socket is
594used to seed the random engine for SSL connections.
595
596See also \fI--random-file\fP.
597.IP "--engine <name>"
598(TLS) Select the OpenSSL crypto engine to use for cipher operations. Use \fI--engine\fP
599list to print a list of build-time supported engines. Note that not all (or
600none) of the engines may be available at run-time.
601.IP "--expect100-timeout <seconds>"
602(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
603response when curl emits an Expects: 100-continue header in its request. By
604default curl will wait one second. This option accepts decimal values! When
605curl stops waiting, it will continue as if the response has been received.
606
607See also \fI--connect-timeout\fP. Added in 7.47.0.
608.IP "--fail-early"
609Fail and exit on the first detected transfer error.
610
611When curl is used to do multiple transfers on the command line, it will
612attempt to operate on each given URL, one by one. By default, it will ignore
613errors if there are more URLs given and the last URL's success will determine
614the error code curl returns. So early failures will be "hidden" by subsequent
615successful transfers.
616
617Using this option, curl will instead return an error on the first transfer
618that fails, independent of the amount of URLs that are given on the command
619line. This way, no transfer failures go undetected by scripts and similar.
620
621This option is global and does not need to be specified for each use of \fI-:, --next\fP.
622
623This option does not imply \fI-f, --fail\fP, which causes transfers to fail due to the
624server's HTTP status code. You can combine the two options, however note \fI-f, --fail\fP
625is not global and is therefore contained by \fI-:, --next\fP.
626
627Added in 7.52.0.
628.IP "-f, --fail"
629(HTTP) Fail silently (no output at all) on server errors. This is mostly done to
630better enable scripts etc to better deal with failed attempts. In normal cases
631when an HTTP server fails to deliver a document, it returns an HTML document
632stating so (which often also describes why and more). This flag will prevent
633curl from outputting that and return error 22.
634
635This method is not fail-safe and there are occasions where non-successful
636response codes will slip through, especially when authentication is involved
637(response codes 401 and 407).
638.IP "--false-start"
639(TLS) Tells curl to use false start during the TLS handshake. False start is a mode
640where a TLS client will start sending application data before verifying the
641server's Finished message, thus saving a round trip when performing a full
642handshake.
643
644This is currently only implemented in the NSS and Secure Transport (on iOS 7.0
645or later, or OS X 10.9 or later) backends.
646
647Added in 7.42.0.
648.IP "--form-string <name=string>"
649(HTTP) Similar to \fI-F, --form\fP except that the value string for the named parameter is used
650literally. Leading \&'@' and \&'<' characters, and the \&';type=' string in
651the value have no special meaning. Use this in preference to \fI-F, --form\fP if
652there's any possibility that the string value may accidentally trigger the
653\&'@' or \&'<' features of \fI-F, --form\fP.
654
655See also \fI-F, --form\fP.
656.IP "-F, --form <name=content>"
657(HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit
658button. This causes curl to POST data using the Content-Type
659multipart/form-data according to RFC 2388. This enables uploading of binary
660files etc. To force the 'content' part to be a file, prefix the file name with
661an @ sign. To just get the content part from a file, prefix the file name with
662the symbol <. The difference between @ and < is then that @ makes a file get
663attached in the post as a file upload, while the < makes a text field and just
664get the contents for that text field from a file.
665
666Example: to send an image to a server, where \&'profile' is the name of the
667form-field to which portrait.jpg will be the input:
668
669 curl -F profile=@portrait.jpg https://example.com/upload.cgi
670
671To read content from stdin instead of a file, use - as the filename. This goes
672for both @ and < constructs. Unfortunately it does not support reading the
673file from a named pipe or similar, as it needs the full size before the
674transfer starts.
675
676You can also tell curl what Content-Type to use by using 'type=', in a manner
677similar to:
678
679 curl -F "web=@index.html;type=text/html" example.com
680
681or
682
683 curl -F "name=daniel;type=text/foo" example.com
684
685You can also explicitly change the name field of a file upload part by setting
686filename=, like this:
687
688 curl -F "file=@localfile;filename=nameinpost" example.com
689
690If filename/path contains ',' or ';', it must be quoted by double-quotes like:
691
692 curl -F "file=@\\"localfile\\";filename=\\"nameinpost\\"" example.com
693
694or
695
696 curl -F 'file=@"localfile";filename="nameinpost"' example.com
697
698Note that if a filename/path is quoted by double-quotes, any double-quote
699or backslash within the filename must be escaped by backslash.
700
701See further examples and details in the MANUAL.
702
703This option can be used multiple times.
704
705This option overrides \fI-d, --data\fP and \fI-I, --head\fP and \fI--upload\fP.
706.IP "--ftp-account <data>"
707(FTP) When an FTP server asks for "account data" after user name and password has
708been provided, this data is sent off using the ACCT command.
709
710If this option is used several times, the last one will be used.
711
712Added in 7.13.0.
713.IP "--ftp-alternative-to-user <command>"
714(FTP) If authenticating with the USER and PASS commands fails, send this command.
715When connecting to Tumbleweed's Secure Transport server over FTPS using a
716client certificate, using "SITE AUTH" will tell the server to retrieve the
717username from the certificate.
718
719Added in 7.15.5.
720.IP "--ftp-create-dirs"
721(FTP SFTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist on
722the server, the standard behavior of curl is to fail. Using this option, curl
723will instead attempt to create missing directories.
724
725See also \fI--create-dirs\fP.
726.IP "--ftp-method <method>"
727(FTP) Control what method curl should use to reach a file on an FTP(S)
728server. The method argument should be one of the following alternatives:
729.RS
730.IP multicwd
731curl does a single CWD operation for each path part in the given URL. For deep
732hierarchies this means very many commands. This is how RFC 1738 says it should
733be done. This is the default but the slowest behavior.
734.IP nocwd
735curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full
736path to the server for all these commands. This is the fastest behavior.
737.IP singlecwd
738curl does one CWD with the full target directory and then operates on the file
739\&"normally" (like in the multicwd case). This is somewhat more standards
740compliant than 'nocwd' but without the full penalty of 'multicwd'.
741.RE
742
743Added in 7.15.1.
744.IP "--ftp-pasv"
745(FTP) Use passive mode for the data connection. Passive is the internal default
746behavior, but using this option can be used to override a previous \fI-P, --ftp-port\fP
747option.
748
749If this option is used several times, only the first one is used. Undoing an
750enforced passive really isn't doable but you must then instead enforce the
751correct \fI-P, --ftp-port\fP again.
752
753Passive mode means that curl will try the EPSV command first and then PASV,
754unless \fI--disable-epsv\fP is used.
755
756See also \fI--disable-epsv\fP. Added in 7.11.0.
757.IP "-P, --ftp-port <address>"
758(FTP) Reverses the default initiator/listener roles when connecting with FTP. This
759option makes curl use active mode. curl then tells the server to connect back
760to the client's specified address and port, while passive mode asks the server
761to setup an IP address and port for it to connect to. <address> should be one
762of:
763.RS
764.IP interface
765i.e "eth0" to specify which interface's IP address you want to use (Unix only)
766.IP "IP address"
767i.e "192.168.10.1" to specify the exact IP address
768.IP "host name"
769i.e "my.host.domain" to specify the machine
770.IP "-"
771make curl pick the same IP address that is already used for the control
772connection
773.RE
774
775If this option is used several times, the last one will be used. Disable the
776use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command
777instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
778
779Since 7.19.5, you can append \&":[start]-[end]\&" to the right of the address,
780to tell curl what TCP port range to use. That means you specify a port range,
781from a lower to a higher number. A single number works as well, but do note
782that it increases the risk of failure since the port may not be available.
783
784See also \fI--ftp-pasv\fP and \fI--disable-eprt\fP.
785.IP "--ftp-pret"
786(FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers,
787mainly drftpd, require this non-standard command for directory listings as
788well as up and downloads in PASV mode.
789
790Added in 7.20.0.
791.IP "--ftp-skip-pasv-ip"
792(FTP) Tell curl to not use the IP address the server suggests in its response
793to curl's PASV command when curl connects the data connection. Instead curl
794will re-use the same IP address it already uses for the control
795connection.
796
797This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
798
799See also \fI--ftp-pasv\fP. Added in 7.14.2.
800.IP "--ftp-ssl-ccc-mode <active/passive>"
801(FTP) Sets the CCC mode. The passive mode will not initiate the shutdown, but
802instead wait for the server to do it, and will not reply to the shutdown from
803the server. The active mode initiates the shutdown and waits for a reply from
804the server.
805
806See also \fI--ftp-ssl-ccc\fP. Added in 7.16.2.
807.IP "--ftp-ssl-ccc"
808(FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after
809authenticating. The rest of the control channel communication will be
810unencrypted. This allows NAT routers to follow the FTP transaction. The
811default mode is passive.
812
813See also \fI--ssl\fP and \fI--ftp-ssl-ccc-mode\fP. Added in 7.16.1.
814.IP "--ftp-ssl-control"
815(FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure
816authentication, but non-encrypted data transfers for efficiency. Fails the
817transfer if the server doesn't support SSL/TLS.
818
819Added in 7.16.0.
820.IP "-G, --get"
821When used, this option will make all data specified with \fI-d, --data\fP, \fI--data-binary\fP
822or \fI--data-urlencode\fP to be used in an HTTP GET request instead of the POST
823request that otherwise would be used. The data will be appended to the URL
824with a '?' separator.
825
826If used in combination with \fI-I, --head\fP, the POST data will instead be appended to
827the URL with a HEAD request.
828
829If this option is used several times, only the first one is used. This is
830because undoing a GET doesn't make sense, but you should then instead enforce
831the alternative method you prefer.
832.IP "-g, --globoff"
833This option switches off the "URL globbing parser". When you set this option,
834you can specify URLs that contain the letters {}[] without having them being
835interpreted by curl itself. Note that these letters are not normal legal URL
836contents but they should be encoded according to the URI standard.
837.IP "-I, --head"
838(HTTP FTP FILE) Fetch the headers only! HTTP-servers feature the command HEAD which this uses
839to get nothing but the header of a document. When used on an FTP or FILE file,
840curl displays the file size and last modification time only.
841.IP "-H, --header <header>"
842(HTTP)
843Extra header to include in the request when sending HTTP to a server. You may
844specify any number of extra headers. Note that if you should add a custom
845header that has the same name as one of the internal ones curl would use, your
846externally set header will be used instead of the internal one. This allows
847you to make even trickier stuff than curl would normally do. You should not
848replace internally set headers without knowing perfectly well what you're
849doing. Remove an internal header by giving a replacement without content on
850the right side of the colon, as in: -H \&"Host:". If you send the custom
851header with no-value then its header must be terminated with a semicolon, such
852as \-H \&"X-Custom-Header;" to send "X-Custom-Header:".
853
854curl will make sure that each header you add/replace is sent with the proper
855end-of-line marker, you should thus \fBnot\fP add that as a part of the header
856content: do not add newlines or carriage returns, they will only mess things up
857for you.
858
859See also the \fI-A, --user-agent\fP and \fI-e, --referer\fP options.
860
861Starting in 7.37.0, you need \fI--proxy-header\fP to send custom headers intended
862for a proxy.
863
864Example:
865
866 curl -H "X-First-Name: Joe" http://example.com/
867
868\fBWARNING\fP: headers set with this option will be set in all requests - even
869after redirects are followed, like when told with \fI-L, --location\fP. This can lead to
870the header being sent to other hosts than the original host, so sensitive
871headers should be used with caution combined with following redirects.
872
873This option can be used multiple times to add/replace/remove multiple headers.
874.IP "-h, --help"
875Usage help. This lists all current command line options with a short
876description.
877.IP "--hostpubmd5 <md5>"
878(SFTP SCP) Pass a string containing 32 hexadecimal digits. The string should
879be the 128 bit MD5 checksum of the remote host's public key, curl will refuse
880the connection with the host unless the md5sums match.
881
882Added in 7.17.1.
883.IP "-0, --http1.0"
884(HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred
885HTTP version.
886
887This option overrides \fI--http1.1\fP and \fI--http2\fP.
888.IP "--http1.1"
889(HTTP) Tells curl to use HTTP version 1.1.
890
891This option overrides \fI-0, --http1.0\fP and \fI--http2\fP. Added in 7.33.0.
892.IP "--http2-prior-knowledge"
893(HTTP) Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1
894Upgrade. It requires prior knowledge that the server supports HTTP/2 straight
895away. HTTPS requests will still do HTTP/2 the standard way with negotiated
896protocol version in the TLS handshake.
897
898\fI--http2-prior-knowledge\fP requires that the underlying libcurl was built to support HTTP/2. This option overrides \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP. Added in 7.49.0.
899.IP "--http2"
900(HTTP) Tells curl to use HTTP version 2.
901
902See also \fI--no-alpn\fP. \fI--http2\fP requires that the underlying libcurl was built to support HTTP/2. This option overrides \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2-prior-knowledge\fP. Added in 7.33.0.
903.IP "--ignore-content-length"
904(FTP HTTP) For HTTP, Ignore the Content-Length header. This is particularly useful for
905servers running Apache 1.x, which will report incorrect Content-Length for
906files larger than 2 gigabytes.
907
908For FTP (since 7.46.0), skip the RETR command to figure out the size before
909downloading a file.
910.IP "-i, --include"
911Include the HTTP-header in the output. The HTTP-header includes things like
912server-name, date of the document, HTTP-version and more...
913
914See also \fI-v, --verbose\fP.
915.IP "-k, --insecure"
916(TLS)
917By default, every SSL connection curl makes is verified to be secure. This
918option allows curl to proceed and operate even for server connections
919otherwise considered insecure.
920
921The server connection is verified by making sure the server's certificate
922contains the right name and verifies successfully using the cert store.
923
924See this online resource for further details:
925 https://curl.haxx.se/docs/sslcerts.html
926
927See also \fI--proxy-insecure\fP and \fI--cacert\fP.
928.IP "--interface <name>"
929
930Perform an operation using a specified interface. You can enter interface
931name, IP address or host name. An example could look like:
932
933 curl --interface eth0:1 https://www.example.com/
934
935If this option is used several times, the last one will be used.
936
937See also \fI--dns-interface\fP.
938.IP "-4, --ipv4"
939This option tells curl to resolve names to IPv4 addresses only, and not for
940example try IPv6.
941
942See also \fI--http1.1\fP and \fI--http2\fP. This option overrides \fI-6, --ipv6\fP.
943.IP "-6, --ipv6"
944This option tells curl to resolve names to IPv6 addresses only, and not for
945example try IPv4.
946
947See also \fI--http1.1\fP and \fI--http2\fP. This option overrides \fI-6, --ipv6\fP.
948.IP "-j, --junk-session-cookies"
949(HTTP) When curl is told to read cookies from a given file, this option will make it
950discard all "session cookies". This will basically have the same effect as if
951a new session is started. Typical browsers always discard session cookies when
952they're closed down.
953
954See also \fI-b, --cookie\fP and \fI-c, --cookie-jar\fP.
955.IP "--keepalive-time <seconds>"
956This option sets the time a connection needs to remain idle before sending
957keepalive probes and the time between individual keepalive probes. It is
958currently effective on operating systems offering the TCP_KEEPIDLE and
959TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This
960option has no effect if \fI--no-keepalive\fP is used.
961
962If this option is used several times, the last one will be used. If
963unspecified, the option defaults to 60 seconds.
964
965Added in 7.18.0.
966.IP "--key-type <type>"
967(TLS) Private key file type. Specify which type your \fI--key\fP provided private key
968is. DER, PEM, and ENG are supported. If not specified, PEM is assumed.
969
970If this option is used several times, the last one will be used.
971.IP "--key <key>"
972(TLS SSH) Private key file name. Allows you to provide your private key in this separate
973file. For SSH, if not specified, curl tries the following candidates in order:
974'~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
975
976If this option is used several times, the last one will be used.
977.IP "--krb <level>"
978(FTP) Enable Kerberos authentication and use. The level must be entered and should
979be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a
980level that is not one of these, 'private' will instead be used.
981
982If this option is used several times, the last one will be used.
983
984\fI--krb\fP requires that the underlying libcurl was built to support Kerberos.
985.IP "--libcurl <file>"
986Append this option to any ordinary curl command line, and you will get a
987libcurl-using C source code written to the file that does the equivalent
988of what your command-line operation does!
989
990If this option is used several times, the last given file name will be
991used.
992
993Added in 7.16.1.
994.IP "--limit-rate <speed>"
995Specify the maximum transfer rate you want curl to use - for both downloads
996and uploads. This feature is useful if you have a limited pipe and you'd like
997your transfer not to use your entire bandwidth. To make it slower than it
998otherwise would be.
999
1000The given speed is measured in bytes/second, unless a suffix is appended.
1001Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it
1002megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
1003
1004If you also use the \fI-Y, --speed-limit\fP option, that option will take precedence and
1005might cripple the rate-limiting slightly, to help keeping the speed-limit
1006logic working.
1007
1008If this option is used several times, the last one will be used.
1009.IP "-l, --list-only"
1010(FTP POP3) (FTP)
1011When listing an FTP directory, this switch forces a name-only view. This is
1012especially useful if the user wants to machine-parse the contents of an FTP
1013directory since the normal directory view doesn't use a standard look or
1014format. When used like this, the option causes a NLST command to be sent to
1015the server instead of LIST.
1016
1017Note: Some FTP servers list only files in their response to NLST; they do not
1018include sub-directories and symbolic links.
1019
1020(POP3)
1021When retrieving a specific email from POP3, this switch forces a LIST command
1022to be performed instead of RETR. This is particularly useful if the user wants
1023to see if a specific message id exists on the server and what size it is.
1024
1025Note: When combined with \fI-X, --request\fP, this option can be used to send an UIDL
1026command instead, so the user may use the email's unique identifier rather than
1027it's message id to make the request.
1028
1029Added in 7.21.5.
1030.IP "--local-port <num/range>"
1031Set a preferred single number or range (FROM-TO) of local port numbers to use
1032for the connection(s). Note that port numbers by nature are a scarce resource
1033that will be busy at times so setting this range to something too narrow might
1034cause unnecessary connection setup failures.
1035
1036Added in 7.15.2.
1037.IP "--location-trusted"
1038(HTTP) Like \fI-L, --location\fP, but will allow sending the name + password to all hosts that
1039the site may redirect to. This may or may not introduce a security breach if
1040the site redirects you to a site to which you'll send your authentication info
1041(which is plaintext in the case of HTTP Basic authentication).
1042
1043See also \fI-u, --user\fP.
1044.IP "-L, --location"
1045(HTTP) If the server reports that the requested page has moved to a different
1046location (indicated with a Location: header and a 3XX response code), this
1047option will make curl redo the request on the new place. If used together with
1048\fI-i, --include\fP or \fI-I, --head\fP, headers from all requested pages will be shown. When
1049authentication is used, curl only sends its credentials to the initial
1050host. If a redirect takes curl to a different host, it won't be able to
1051intercept the user+password. See also \fI--location-trusted\fP on how to change
1052this. You can limit the amount of redirects to follow by using the
1053\fI--max-redirs\fP option.
1054
1055When curl follows a redirect and the request is not a plain GET (for example
1056POST or PUT), it will do the following request with a GET if the HTTP response
1057was 301, 302, or 303. If the response code was any other 3xx code, curl will
1058re-send the following request using the same unmodified method.
1059
1060You can tell curl to not change the non-GET request method to GET after a 30x
1061response by using the dedicated options for that: \fI--post301\fP, \fI--post302\fP and
1062\fI--post303\fP.
1063.IP "--login-options <options>"
1064(IMAP POP3 SMTP) Specify the login options to use during server authentication.
1065
1066You can use the login options to specify protocol specific options that may
1067be used during authentication. At present only IMAP, POP3 and SMTP support
1068login options. For more information about the login options please see
1069RFC 2384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt
1070
1071If this option is used several times, the last one will be used.
1072
1073Added in 7.34.0.
1074.IP "--mail-auth <address>"
1075(SMTP) Specify a single address. This will be used to specify the authentication
1076address (identity) of a submitted message that is being relayed to another
1077server.
1078
1079See also \fI--mail-rcpt\fP and \fI--mail-from\fP. Added in 7.25.0.
1080.IP "--mail-from <address>"
1081(SMTP) Specify a single address that the given mail should get sent from.
1082
1083See also \fI--mail-rcpt\fP and \fI--mail-auth\fP. Added in 7.20.0.
1084.IP "--mail-rcpt <address>"
1085(SMTP) Specify a single address, user name or mailing list name. Repeat this
1086option several times to send to multiple recipients.
1087
1088When performing a mail transfer, the recipient should specify a valid email
1089address to send the mail to.
1090
1091When performing an address verification (VRFY command), the recipient should be
1092specified as the user name or user name and domain (as per Section 3.5 of
1093RFC5321). (Added in 7.34.0)
1094
1095When performing a mailing list expand (EXPN command), the recipient should be
1096specified using the mailing list name, such as "Friends" or "London-Office".
1097(Added in 7.34.0)
1098
1099Added in 7.20.0.
1100.IP "-M, --manual"
1101Manual. Display the huge help text.
1102.IP "--max-filesize <bytes>"
1103Specify the maximum size (in bytes) of a file to download. If the file
1104requested is larger than this value, the transfer will not start and curl will
1105return with exit code 63.
1106
1107\fBNOTE:\fP The file size is not always known prior to download, and for such
1108files this option has no effect even if the file transfer ends up being larger
1109than this given limit. This concerns both FTP and HTTP transfers.
1110
1111See also \fI--limit-rate\fP.
1112.IP "--max-redirs <num>"
1113(HTTP) Set maximum number of redirection-followings allowed. When \fI-L, --location\fP is used,
1114is used to prevent curl from following redirections \&"in absurdum". By
1115default, the limit is set to 50 redirections. Set this option to -1 to make it
1116unlimited.
1117
1118If this option is used several times, the last one will be used.
1119.IP "-m, --max-time <time>"
1120Maximum time in seconds that you allow the whole operation to take. This is
1121useful for preventing your batch jobs from hanging for hours due to slow
1122networks or links going down. Since 7.32.0, this option accepts decimal
1123values, but the actual timeout will decrease in accuracy as the specified
1124timeout increases in decimal precision.
1125
1126If this option is used several times, the last one will be used.
1127
1128See also \fI--connect-timeout\fP.
1129.IP "--metalink"
1130This option can tell curl to parse and process a given URI as Metalink file
1131(both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors
1132listed within for failover if there are errors (such as the file or server not
1133being available). It will also verify the hash of the file after the download
1134completes. The Metalink file itself is downloaded and processed in memory and
1135not stored in the local file system.
1136
1137Example to use a remote Metalink file:
1138
1139 curl --metalink http://www.example.com/example.metalink
1140
1141To use a Metalink file in the local file system, use FILE protocol (file://):
1142
1143 curl --metalink file://example.metalink
1144
1145Please note that if FILE protocol is disabled, there is no way to use a local
1146Metalink file at the time of this writing. Also note that if \fI--metalink\fP and
1147\fI-i, --include\fP are used together, --include will be ignored. This is because
1148including headers in the response will break Metalink parser and if the
1149headers are included in the file described in Metalink file, hash check will
1150fail.
1151
1152
1153\fI--metalink\fP requires that the underlying libcurl was built to support metalink. Added in 7.27.0.
1154.IP "--negotiate"
1155(HTTP) Enables Negotiate (SPNEGO) authentication.
1156
1157This option requires a library built with GSS-API or SSPI support. Use
1158\fI-V, --version\fP to see if your curl supports GSS-API/SSPI or SPNEGO.
1159
1160When using this option, you must also provide a fake \fI-u, --user\fP option to activate
1161the authentication code properly. Sending a '-u :' is enough as the user name
1162and password from the \fI-u, --user\fP option aren't actually used.
1163
1164If this option is used several times, only the first one is used.
1165
1166See also \fI--basic\fP and \fI--ntlm\fP and \fI--anyauth\fP and \fI--proxy-negotiate\fP.
1167.IP "--netrc-file <filename>"
1168This option is similar to \fI-n, --netrc\fP, except that you provide the path (absolute
1169or relative) to the netrc file that Curl should use. You can only specify one
1170netrc file per invocation. If several \fI--netrc-file\fP options are provided,
1171the last one will be used.
1172
1173It will abide by \fI--netrc-optional\fP if specified.
1174
1175This option overrides \fI-n, --netrc\fP. Added in 7.21.5.
1176.IP "--netrc-optional"
1177Very similar to \fI-n, --netrc\fP, but this option makes the .netrc usage \fBoptional\fP
1178and not mandatory as the \fI-n, --netrc\fP option does.
1179
1180See also \fI--netrc-file\fP. This option overrides \fI-n, --netrc\fP.
1181.IP "-n, --netrc"
1182Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
1183home directory for login name and password. This is typically used for FTP on
1184Unix. If used with HTTP, curl will enable user authentication. See
1185\fInetrc(5)\fP \fIftp(1)\fP for details on the file format. Curl will not
1186complain if that file doesn't have the right permissions (it should not be
1187either world- or group-readable). The environment variable "HOME" is used to
1188find the home directory.
1189
1190A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
1191to FTP to the machine host.domain.com with user name \&'myself' and password
1192\&'secret' should look similar to:
1193
1194.B "machine host.domain.com login myself password secret"
1195.IP "-:, --next"
1196Tells curl to use a separate operation for the following URL and associated
1197options. This allows you to send several URL requests, each with their own
1198specific options, for example, such as different user names or custom requests
1199for each.
1200
1201\fI-:, --next\fP will reset all local options and only global ones will have their
1202values survive over to the operation following the \fI-:, --next\fP instruction. Global
1203options include \fI-v, --verbose\fP, \fI--trace\fP, \fI--trace-ascii\fP and \fI--fail-early\fP.
1204
1205For example, you can do both a GET and a POST in a single command line:
1206
1207 curl www1.example.com --next -d postthis www2.example.com
1208
1209Added in 7.36.0.
1210.IP "--no-alpn"
1211(HTTPS) Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built
1212with an SSL library that supports ALPN. ALPN is used by a libcurl that supports
1213HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
1214
1215See also \fI--no-npn\fP and \fI--http2\fP. \fI--no-alpn\fP requires that the underlying libcurl was built to support TLS. Added in 7.36.0.
1216.IP "-N, --no-buffer"
1217Disables the buffering of the output stream. In normal work situations, curl
1218will use a standard buffered output stream that will have the effect that it
1219will output the data in chunks, not necessarily exactly when the data arrives.
1220Using this option will disable that buffering.
1221
1222Note that this is the negated option name documented. You can thus use
1223--buffer to enforce the buffering.
1224.IP "--no-keepalive"
1225Disables the use of keepalive messages on the TCP connection. curl otherwise
1226enables them by default.
1227
1228Note that this is the negated option name documented. You can thus use
1229--keepalive to enforce keepalive.
1230.IP "--no-npn"
1231(HTTPS) Disable the NPN TLS extension. NPN is enabled by default if libcurl was built
1232with an SSL library that supports NPN. NPN is used by a libcurl that supports
1233HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
1234
1235See also \fI--no-alpn\fP and \fI--http2\fP. \fI--no-npn\fP requires that the underlying libcurl was built to support TLS. Added in 7.36.0.
1236.IP "--no-sessionid"
1237(TLS) Disable curl's use of SSL session-ID caching. By default all transfers are
1238done using the cache. Note that while nothing should ever get hurt by
1239attempting to reuse SSL session-IDs, there seem to be broken SSL
1240implementations in the wild that may require you to disable this in order for
1241you to succeed.
1242
1243Note that this is the negated option name documented. You can thus use
1244--sessionid to enforce session-ID caching.
1245
1246Added in 7.16.0.
1247.IP "--noproxy <no-proxy-list>"
1248Comma-separated list of hosts which do not use a proxy, if one is specified.
1249The only wildcard is a single * character, which matches all hosts, and
1250effectively disables the proxy. Each name in this list is matched as either
1251a domain which contains the hostname, or the hostname itself. For example,
1252local.com would match local.com, local.com:80, and www.local.com, but not
1253www.notlocal.com.
1254
1255Since 7.53.0, This option overrides the environment variables that disable the
1256proxy. If there's an environment variable disabling a proxy, you can set
1257noproxy list to \&"" to override it.
1258
1259Added in 7.19.4.
1260.IP "--ntlm-wb"
1261(HTTP) Enables NTLM much in the style \fI--ntlm\fP does, but hand over the authentication
1262to the separate binary ntlmauth application that is executed when needed.
1263
1264See also \fI--ntlm\fP and \fI--proxy-ntlm\fP.
1265.IP "--ntlm"
1266(HTTP) Enables NTLM authentication. The NTLM authentication method was designed by
1267Microsoft and is used by IIS web servers. It is a proprietary protocol,
1268reverse-engineered by clever people and implemented in curl based on their
1269efforts. This kind of behavior should not be endorsed, you should encourage
1270everyone who uses NTLM to switch to a public and documented authentication
1271method instead, such as Digest.
1272
1273If you want to enable NTLM for your proxy authentication, then use
1274\fI--proxy-ntlm\fP.
1275
1276If this option is used several times, only the first one is used.
1277
1278See also \fI--proxy-ntlm\fP. \fI--ntlm\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI--basic\fP and \fI--negotiated\fP and \fI--digest\fP and \fI--anyauth\fP.
1279.IP "--oauth2-bearer <token>"
1280(IMAP POP3 SMTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token
1281is used in conjunction with the user name which can be specified as part of
1282the \fI--url\fP or \fI-u, --user\fP options.
1283
1284The Bearer Token and user name are formatted according to RFC 6750.
1285
1286If this option is used several times, the last one will be used.
1287.IP "-o, --output <file>"
1288Write output to <file> instead of stdout. If you are using {} or [] to fetch
1289multiple documents, you can use '#' followed by a number in the <file>
1290specifier. That variable will be replaced with the current string for the URL
1291being fetched. Like in:
1292
1293 curl http://{one,two}.example.com -o "file_#1.txt"
1294
1295or use several variables like:
1296
1297 curl http://{site,host}.host[1-5].com -o "#1_#2"
1298
1299You may use this option as many times as the number of URLs you have. For
1300example, if you specify two URLs on the same command line, you can use it like
1301this:
1302
1303 curl -o aa example.com -o bb example.net
1304
1305and the order of the -o options and the URLs doesn't matter, just that the
1306first -o is for the first URL and so on, so the above command line can also be
1307written as
1308
1309 curl example.com example.net -o aa -o bb
1310
1311See also the \fI--create-dirs\fP option to create the local directories
1312dynamically. Specifying the output as '-' (a single dash) will force the
1313output to be done to stdout.
1314
1315See also \fI-O, --remote-name\fP and \fI--remote-name-all\fP and \fI-J, --remote-header-name\fP.
1316.IP "--pass <phrase>"
1317(SSH TLS) Passphrase for the private key
1318
1319If this option is used several times, the last one will be used.
1320.IP "--path-as-is"
1321Tell curl to not handle sequences of /../ or /./ in the given URL
1322path. Normally curl will squash or merge them according to standards but with
1323this option set you tell it not to do that.
1324
1325Added in 7.42.0.
1326.IP "--pinnedpubkey <hashes>"
1327(TLS) Tells curl to use the specified public key file (or hashes) to verify the
1328peer. This can be a path to a file which contains a single public key in PEM
1329or DER format, or any number of base64 encoded sha256 hashes preceded by
1330\'sha256//\' and separated by \';\'
1331
1332When negotiating a TLS or SSL connection, the server sends a certificate
1333indicating its identity. A public key is extracted from this certificate and
1334if it does not exactly match the public key provided to this option, curl will
1335abort the connection before sending or receiving any data.
1336
1337PEM/DER support:
1338 7.39.0: OpenSSL, GnuTLS and GSKit
1339 7.43.0: NSS and wolfSSL/CyaSSL
1340 7.47.0: mbedtls
1341 7.49.0: PolarSSL
1342sha256 support:
1343 7.44.0: OpenSSL, GnuTLS, NSS and wolfSSL/CyaSSL.
1344 7.47.0: mbedtls
1345 7.49.0: PolarSSL
1346Other SSL backends not supported.
1347
1348If this option is used several times, the last one will be used.
1349.IP "--post301"
1350(HTTP) Tells curl to respect RFC 7231/6.4.2 and not convert POST requests into GET
1351requests when following a 301 redirection. The non-RFC behaviour is ubiquitous
1352in web browsers, so curl does the conversion by default to maintain
1353consistency. However, a server may require a POST to remain a POST after such
1354a redirection. This option is meaningful only when using \fI-L, --location\fP.
1355
1356See also \fI--post302\fP and \fI--post303\fP and \fI-L, --location\fP. Added in 7.17.1.
1357.IP "--post302"
1358(HTTP) Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET
1359requests when following a 302 redirection. The non-RFC behaviour is ubiquitous
1360in web browsers, so curl does the conversion by default to maintain
1361consistency. However, a server may require a POST to remain a POST after such
1362a redirection. This option is meaningful only when using \fI-L, --location\fP.
1363
1364See also \fI--post301\fP and \fI--post303\fP and \fI-L, --location\fP. Added in 7.19.1.
1365.IP "--post303"
1366(HTTP) Tells curl to respect RFC 7231/6.4.4 and not convert POST requests into GET
1367requests when following a 303 redirection. The non-RFC behaviour is ubiquitous
1368in web browsers, so curl does the conversion by default to maintain
1369consistency. However, a server may require a POST to remain a POST after such
1370a redirection. This option is meaningful only when using \fI-L, --location\fP.
1371
1372See also \fI--post302\fP and \fI--post301\fP and \fI-L, --location\fP. Added in 7.26.0.
1373.IP "--preproxy [protocol://]host[:port]"
1374Use the specified SOCKS proxy before connecting to an HTTP or HTTPS \fI-x, --proxy\fP. In
1375such a case curl first connects to the SOCKS proxy and then connects (through
1376SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy.
1377
1378The pre proxy string should be specified with a protocol:// prefix to specify
1379alternative proxy protocols. Use socks4://, socks4a://, socks5:// or
1380socks5h:// to request the specific SOCKS version to be used. No protocol
1381specified will make curl default to SOCKS4.
1382
1383If the port number is not specified in the proxy string, it is assumed to be
13841080.
1385
1386User and password that might be provided in the proxy string are URL decoded
1387by curl. This allows you to pass in special characters such as @ by using %40
1388or pass in a colon with %3a.
1389
1390If this option is used several times, the last one will be used.
1391
1392Added in 7.52.0.
1393.IP "-#, --progress-bar"
1394Make curl display transfer progress as a simple progress bar instead of the
1395standard, more informational, meter.
1396
1397This progress bar draws a single line of '#' characters across the screen and
1398shows a percentage if the transfer size is known. For transfers without a
1399known size, it will instead output one '#' character for every 1024 bytes
1400transferred.
1401.IP "--proto-default <protocol>"
1402Tells curl to use \fIprotocol\fP for any URL missing a scheme name.
1403
1404Example:
1405
1406 curl --proto-default https ftp.mozilla.org
1407
1408An unknown or unsupported protocol causes error
1409\fICURLE_UNSUPPORTED_PROTOCOL\fP (1).
1410
1411This option does not change the default proxy protocol (http).
1412
1413Without this option curl would make a guess based on the host, see \fI--url\fP for
1414details.
1415
1416Added in 7.45.0.
1417.IP "--proto-redir <protocols>"
1418Tells curl to limit what protocols it may use on redirect. Protocols denied by
1419\fI--proto\fP are not overridden by this option. See --proto for how protocols are
1420represented.
1421
1422Example, allow only HTTP and HTTPS on redirect:
1423
1424 curl --proto-redir -all,http,https http://example.com
1425
1426By default curl will allow all protocols on redirect except several disabled
1427for security reasons: Since 7.19.4 FILE and SCP are disabled, and since 7.40.0
1428SMB and SMBS are also disabled. Specifying \fIall\fP or \fI+all\fP enables all
1429protocols on redirect, including those disabled for security.
1430
1431Added in 7.20.2.
1432.IP "--proto <protocols>"
1433Tells curl to limit what protocols it may use in the transfer. Protocols are
1434evaluated left to right, are comma separated, and are each a protocol name or
1435'all', optionally prefixed by zero or more modifiers. Available modifiers are:
1436.RS
1437.TP 3
1438.B +
1439Permit this protocol in addition to protocols already permitted (this is
1440the default if no modifier is used).
1441.TP
1442.B -
1443Deny this protocol, removing it from the list of protocols already permitted.
1444.TP
1445.B =
1446Permit only this protocol (ignoring the list already permitted), though
1447subject to later modification by subsequent entries in the comma separated
1448list.
1449.RE
1450.IP
1451For example:
1452.RS
1453.TP 15
1454.B \fI--proto\fP -ftps
1455uses the default protocols, but disables ftps
1456.TP
1457.B \fI--proto\fP -all,https,+http
1458only enables http and https
1459.TP
1460.B \fI--proto\fP =http,https
1461also only enables http and https
1462.RE
1463
1464Unknown protocols produce a warning. This allows scripts to safely rely on
1465being able to disable potentially dangerous protocols, without relying upon
1466support for that protocol being built into curl to avoid an error.
1467
1468This option can be used multiple times, in which case the effect is the same
1469as concatenating the protocols into one instance of the option.
1470
1471See also \fI--proto-redir\fP and \fI--proto-default\fP. Added in 7.20.2.
1472.IP "--proxy-anyauth"
1473Tells curl to pick a suitable authentication method when communicating with
1474the given HTTP proxy. This might cause an extra request/response round-trip.
1475
1476See also \fI-x, --proxy\fP and \fI--proxy-basic\fP and \fI--proxy-digest\fP. Added in 7.13.2.
1477.IP "--proxy-basic"
1478Tells curl to use HTTP Basic authentication when communicating with the given
1479proxy. Use \fI--basic\fP for enabling HTTP Basic with a remote host. Basic is the
1480default authentication method curl uses with proxies.
1481
1482See also \fI-x, --proxy\fP and \fI--proxy-anyauth\fP and \fI--proxy-digest\fP.
1483.IP "--proxy-cacert <file>"
1484Same as \fI--cacert\fP but used in HTTPS proxy context.
1485
1486See also \fI--proxy-capath\fP and \fI--cacert\fP and \fI--capath\fP and \fI-x, --proxy\fP. Added in 7.52.0.
1487.IP "--proxy-capath <dir>"
1488Same as \fI--capath\fP but used in HTTPS proxy context.
1489
1490See also \fI--proxy-cacert\fP and \fI-x, --proxy\fP and \fI--capath\fP. Added in 7.52.0.
1491.IP "--proxy-cert-type <type>"
1492Same as \fI--cert-type\fP but used in HTTPS proxy context.
1493
1494Added in 7.52.0.
1495.IP "--proxy-cert <cert[:passwd]>"
1496Same as \fI-E, --cert\fP but used in HTTPS proxy context.
1497
1498Added in 7.52.0.
1499.IP "--proxy-ciphers <list>"
1500Same as \fI--ciphers\fP but used in HTTPS proxy context.
1501
1502Added in 7.52.0.
1503.IP "--proxy-crlfile <file>"
1504Same as \fI--crlfile\fP but used in HTTPS proxy context.
1505
1506Added in 7.52.0.
1507.IP "--proxy-digest"
1508Tells curl to use HTTP Digest authentication when communicating with the given
1509proxy. Use \fI--digest\fP for enabling HTTP Digest with a remote host.
1510
1511See also \fI-x, --proxy\fP and \fI--proxy-anyauth\fP and \fI--proxy-basic\fP.
1512.IP "--proxy-header <header>"
1513(HTTP) Extra header to include in the request when sending HTTP to a proxy. You may
1514specify any number of extra headers. This is the equivalent option to \fI-H, --header\fP
1515but is for proxy communication only like in CONNECT requests when you want a
1516separate header sent to the proxy to what is sent to the actual remote host.
1517
1518curl will make sure that each header you add/replace is sent with the proper
1519end-of-line marker, you should thus \fBnot\fP add that as a part of the header
1520content: do not add newlines or carriage returns, they will only mess things
1521up for you.
1522
1523Headers specified with this option will not be included in requests that curl
1524knows will not be sent to a proxy.
1525
1526This option can be used multiple times to add/replace/remove multiple headers.
1527
1528Added in 7.37.0.
1529.IP "--proxy-insecure"
1530Same as \fI-k, --insecure\fP but used in HTTPS proxy context.
1531
1532Added in 7.52.0.
1533.IP "--proxy-key-type <type>"
1534Same as \fI--key-type\fP but used in HTTPS proxy context.
1535
1536Added in 7.52.0.
1537.IP "--proxy-key <key>"
1538Same as \fI--key\fP but used in HTTPS proxy context.
1539.IP "--proxy-negotiate"
1540Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating
1541with the given proxy. Use \fI--negotiate\fP for enabling HTTP Negotiate (SPNEGO)
1542with a remote host.
1543
1544See also \fI--proxy-anyauth\fP and \fI--proxy-basic\fP. Added in 7.17.1.
1545.IP "--proxy-ntlm"
1546Tells curl to use HTTP NTLM authentication when communicating with the given
1547proxy. Use \fI--ntlm\fP for enabling NTLM with a remote host.
1548
1549See also \fI--proxy-negotiate\fP and \fI--proxy-anyauth\fP.
1550.IP "--proxy-pass <phrase>"
1551Same as \fI--pass\fP but used in HTTPS proxy context.
1552
1553Added in 7.52.0.
1554.IP "--proxy-service-name <name>"
1555This option allows you to change the service name for proxy negotiation.
1556
1557Added in 7.43.0.
1558.IP "--proxy-ssl-allow-beast"
1559Same as \fI--ssl-allow-beast\fP but used in HTTPS proxy context.
1560
1561Added in 7.52.0.
1562.IP "--proxy-tlsauthtype <type>"
1563Same as \fI--tlsauthtype\fP but used in HTTPS proxy context.
1564
1565Added in 7.52.0.
1566.IP "--proxy-tlspassword <string>"
1567Same as \fI--tlspassword\fP but used in HTTPS proxy context.
1568
1569Added in 7.52.0.
1570.IP "--proxy-tlsuser <name>"
1571Same as \fI--tlsuser\fP but used in HTTPS proxy context.
1572
1573Added in 7.52.0.
1574.IP "--proxy-tlsv1"
1575Same as \fI-1, --tlsv1\fP but used in HTTPS proxy context.
1576
1577Added in 7.52.0.
1578.IP "-U, --proxy-user <user:password>"
1579Specify the user name and password to use for proxy authentication.
1580
1581If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM
1582authentication then you can tell curl to select the user name and password
1583from your environment by specifying a single colon with this option: "-U :".
1584
1585If this option is used several times, the last one will be used.
1586.IP "-x, --proxy [protocol://]host[:port]"
1587Use the specified proxy.
1588
1589The proxy string can be specified with a protocol:// prefix. No protocol
1590specified or http:// will be treated as HTTP proxy. Use socks4://, socks4a://,
1591socks5:// or socks5h:// to request a specific SOCKS version to be used.
1592(The protocol support was added in curl 7.21.7)
1593
1594HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for
1595OpenSSL, GnuTLS and NSS.
1596
1597Unrecognized and unsupported proxy protocols cause an error since 7.52.0.
1598Prior versions may ignore the protocol and use http:// instead.
1599
1600If the port number is not specified in the proxy string, it is assumed to be
16011080.
1602
1603This option overrides existing environment variables that set the proxy to
1604use. If there's an environment variable setting a proxy, you can set proxy to
1605\&"" to override it.
1606
1607All operations that are performed over an HTTP proxy will transparently be
1608converted to HTTP. It means that certain protocol specific operations might
1609not be available. This is not the case if you can tunnel through the proxy, as
1610one with the \fI-p, --proxytunnel\fP option.
1611
1612User and password that might be provided in the proxy string are URL decoded
1613by curl. This allows you to pass in special characters such as @ by using %40
1614or pass in a colon with %3a.
1615
1616The proxy host can be specified the exact same way as the proxy environment
1617variables, including the protocol prefix (http://) and the embedded user +
1618password.
1619
1620If this option is used several times, the last one will be used.
1621.IP "--proxy1.0 <host[:port]>"
1622Use the specified HTTP 1.0 proxy. If the port number is not specified, it is
1623assumed at port 1080.
1624
1625The only difference between this and the HTTP proxy option \fI-x, --proxy\fP, is that
1626attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol
1627instead of the default HTTP 1.1.
1628.IP "-p, --proxytunnel"
1629When an HTTP proxy is used \fI-x, --proxy\fP, this option will cause non-HTTP protocols
1630to attempt to tunnel through the proxy instead of merely using it to do
1631HTTP-like operations. The tunnel approach is made with the HTTP proxy CONNECT
1632request and requires that the proxy allows direct connect to the remote port
1633number curl wants to tunnel through to.
1634
1635To suppress proxy CONNECT response headers when curl is set to output headers
1636use \fI--suppress-connect-headers\fP.
1637
1638See also \fI-x, --proxy\fP.
1639.IP "--pubkey <key>"
1640(SFTP SCP) Public key file name. Allows you to provide your public key in this separate
1641file.
1642
1643If this option is used several times, the last one will be used.
1644
1645(As of 7.39.0, curl attempts to automatically extract the public key from the
1646private key file, so passing this option is generally not required. Note that
1647this public key extraction requires libcurl to be linked against a copy of
1648libssh2 1.2.8 or higher that is itself linked against OpenSSL.)
1649.IP "-Q, --quote"
1650(FTP SFTP)
1651Send an arbitrary command to the remote FTP or SFTP server. Quote commands are
1652sent BEFORE the transfer takes place (just after the initial PWD command in an
1653FTP transfer, to be exact). To make commands take place after a successful
1654transfer, prefix them with a dash '-'. To make commands be sent after curl
1655has changed the working directory, just before the transfer command(s), prefix
1656the command with a '+' (this is only supported for FTP). You may specify any
1657number of commands.
1658
1659If the server returns failure for one of the commands, the entire operation
1660will be aborted. You must send syntactically correct FTP commands as RFC 959
1661defines to FTP servers, or one of the commands listed below to SFTP servers.
1662
1663This option can be used multiple times. When speaking to an FTP server, prefix
1664the command with an asterisk (*) to make curl continue even if the command
1665fails as by default curl will stop at first failure.
1666
1667SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
1668itself before sending them to the server. File names may be quoted
1669shell-style to embed spaces or special characters. Following is the list of
1670all supported SFTP quote commands:
1671.RS
1672.IP "chgrp group file"
1673The chgrp command sets the group ID of the file named by the file operand to
1674the group ID specified by the group operand. The group operand is a decimal
1675integer group ID.
1676.IP "chmod mode file"
1677The chmod command modifies the file mode bits of the specified file. The
1678mode operand is an octal integer mode number.
1679.IP "chown user file"
1680The chown command sets the owner of the file named by the file operand to the
1681user ID specified by the user operand. The user operand is a decimal
1682integer user ID.
1683.IP "ln source_file target_file"
1684The ln and symlink commands create a symbolic link at the target_file location
1685pointing to the source_file location.
1686.IP "mkdir directory_name"
1687The mkdir command creates the directory named by the directory_name operand.
1688.IP "pwd"
1689The pwd command returns the absolute pathname of the current working directory.
1690.IP "rename source target"
1691The rename command renames the file or directory named by the source
1692operand to the destination path named by the target operand.
1693.IP "rm file"
1694The rm command removes the file specified by the file operand.
1695.IP "rmdir directory"
1696The rmdir command removes the directory entry specified by the directory
1697operand, provided it is empty.
1698.IP "symlink source_file target_file"
1699See ln.
1700.RE
1701.IP "--random-file <file>"
1702Specify the path name to file containing what will be considered as random
1703data. The data may be used to seed the random engine for SSL connections. See
1704also the \fI--egd-file\fP option.
1705.IP "-r, --range <range>"
1706(HTTP FTP SFTP FILE) Retrieve a byte range (i.e a partial document) from a HTTP/1.1, FTP or SFTP
1707server or a local FILE. Ranges can be specified in a number of ways.
1708.RS
1709.TP 10
1710.B 0-499
1711specifies the first 500 bytes
1712.TP
1713.B 500-999
1714specifies the second 500 bytes
1715.TP
1716.B -500
1717specifies the last 500 bytes
1718.TP
1719.B 9500-
1720specifies the bytes from offset 9500 and forward
1721.TP
1722.B 0-0,-1
1723specifies the first and last byte only(*)(HTTP)
1724.TP
1725.B 100-199,500-599
1726specifies two separate 100-byte ranges(*) (HTTP)
1727.RE
1728.IP
1729(*) = NOTE that this will cause the server to reply with a multipart
1730response!
1731
1732Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
1733\&'start-stop' range syntax. If a non-digit character is given in the range,
1734the server's response will be unspecified, depending on the server's
1735configuration.
1736
1737You should also be aware that many HTTP/1.1 servers do not have this feature
1738enabled, so that when you attempt to get a range, you'll instead get the whole
1739document.
1740
1741FTP and SFTP range downloads only support the simple 'start-stop' syntax
1742(optionally with one of the numbers omitted). FTP use depends on the extended
1743FTP command SIZE.
1744
1745If this option is used several times, the last one will be used.
1746.IP "--raw"
1747(HTTP) When used, it disables all internal HTTP decoding of content or transfer
1748encodings and instead makes them passed on unaltered, raw.
1749
1750Added in 7.16.2.
1751.IP "-e, --referer <URL>"
1752(HTTP) Sends the "Referrer Page" information to the HTTP server. This can also be set
1753with the \fI-H, --header\fP flag of course. When used with \fI-L, --location\fP you can append
1754";auto" to the \fI-e, --referer\fP URL to make curl automatically set the previous URL
1755when it follows a Location: header. The \&";auto" string can be used alone,
1756even if you don't set an initial \fI-e, --referer\fP.
1757
1758If this option is used several times, the last one will be used.
1759
1760See also \fI-A, --user-agent\fP and \fI-H, --header\fP.
1761.IP "-J, --remote-header-name"
1762(HTTP) This option tells the \fI-O, --remote-name\fP option to use the server-specified
1763Content-Disposition filename instead of extracting a filename from the URL.
1764
1765If the server specifies a file name and a file with that name already exists
1766in the current working directory it will not be overwritten and an error will
1767occur. If the server doesn't specify a file name then this option has no
1768effect.
1769
1770There's no attempt to decode %-sequences (yet) in the provided file name, so
1771this option may provide you with rather unexpected file names.
1772
1773\fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
1774rogue server could send you the name of a DLL or other file that could possibly
1775be loaded automatically by Windows or some third party software.
1776.IP "--remote-name-all"
1777This option changes the default action for all given URLs to be dealt with as
1778if \fI-O, --remote-name\fP were used for each one. So if you want to disable that for a
1779specific URL after \fI--remote-name-all\fP has been used, you must use "-o -" or
1780--no-remote-name.
1781
1782Added in 7.19.0.
1783.IP "-O, --remote-name"
1784Write output to a local file named like the remote file we get. (Only the file
1785part of the remote file is used, the path is cut off.)
1786
1787The file will be saved in the current working directory. If you want the file
1788saved in a different directory, make sure you change the current working
1789directory before invoking curl with this option.
1790
1791The remote file name to use for saving is extracted from the given URL,
1792nothing else, and if it already exists it will be overwritten. If you want the
1793server to be able to choose the file name refer to \fI-J, --remote-header-name\fP which
1794can be used in addition to this option. If the server chooses a file name and
1795that name already exists it will not be overwritten.
1796
1797There is no URL decoding done on the file name. If it has %20 or other URL
1798encoded parts of the name, they will end up as-is as file name.
1799
1800You may use this option as many times as the number of URLs you have.
1801.IP "-R, --remote-time"
1802When used, this will make curl attempt to figure out the timestamp of the
1803remote file, and if that is available make the local file get that same
1804timestamp.
1805.IP "-X, --request <command>"
1806(HTTP) Specifies a custom request method to use when communicating with the
1807HTTP server. The specified request method will be used instead of the method
1808otherwise used (which defaults to GET). Read the HTTP 1.1 specification for
1809details and explanations. Common additional HTTP requests include PUT and
1810DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
1811more.
1812
1813Normally you don't need this option. All sorts of GET, HEAD, POST and PUT
1814requests are rather invoked by using dedicated command line options.
1815
1816This option only changes the actual word used in the HTTP request, it does not
1817alter the way curl behaves. So for example if you want to make a proper HEAD
1818request, using -X HEAD will not suffice. You need to use the \fI-I, --head\fP option.
1819
1820The method string you set with \fI-X, --request\fP will be used for all requests, which
1821if you for example use \fI-L, --location\fP may cause unintended side-effects when curl
1822doesn't change request method according to the HTTP 30x response codes - and
1823similar.
1824
1825(FTP)
1826Specifies a custom FTP command to use instead of LIST when doing file lists
1827with FTP.
1828
1829(POP3)
1830Specifies a custom POP3 command to use instead of LIST or RETR. (Added in
18317.26.0)
1832
1833(IMAP)
1834Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0)
1835
1836(SMTP)
1837Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)
1838
1839If this option is used several times, the last one will be used.
1840.IP "--resolve <host:port:address>"
1841Provide a custom address for a specific host and port pair. Using this, you
1842can make the curl requests(s) use a specified address and prevent the
1843otherwise normally resolved address to be used. Consider it a sort of
1844/etc/hosts alternative provided on the command line. The port number should be
1845the number used for the specific protocol the host will be used for. It means
1846you need several entries if you want to provide address for the same host but
1847different ports.
1848
1849The provided address set by this option will be used even if \fI-4, --ipv4\fP or \fI-6, --ipv6\fP
1850is set to make curl use another IP version.
1851
1852This option can be used many times to add many host names to resolve.
1853
1854Added in 7.21.3.
1855.IP "--retry-connrefused"
1856In addition to the other conditions, consider ECONNREFUSED as a transient
1857error too for \fI--retry\fP. This option is used together with --retry.
1858
1859Added in 7.52.0.
1860.IP "--retry-delay <seconds>"
1861Make curl sleep this amount of time before each retry when a transfer has
1862failed with a transient error (it changes the default backoff time algorithm
1863between retries). This option is only interesting if \fI--retry\fP is also
1864used. Setting this delay to zero will make curl use the default backoff time.
1865
1866If this option is used several times, the last one will be used.
1867
1868Added in 7.12.3.
1869.IP "--retry-max-time <seconds>"
1870The retry timer is reset before the first transfer attempt. Retries will be
1871done as usual (see \fI--retry\fP) as long as the timer hasn't reached this given
1872limit. Notice that if the timer hasn't reached the limit, the request will be
1873made and while performing, it may take longer than this given time period. To
1874limit a single request\'s maximum time, use \fI-m, --max-time\fP. Set this option to
1875zero to not timeout retries.
1876
1877If this option is used several times, the last one will be used.
1878
1879Added in 7.12.3.
1880.IP "--retry <num>"
1881If a transient error is returned when curl tries to perform a transfer, it
1882will retry this number of times before giving up. Setting the number to 0
1883makes curl do no retries (which is the default). Transient error means either:
1884a timeout, an FTP 4xx response code or an HTTP 5xx response code.
1885
1886When curl is about to retry a transfer, it will first wait one second and then
1887for all forthcoming retries it will double the waiting time until it reaches
188810 minutes which then will be the delay between the rest of the retries. By
1889using \fI--retry-delay\fP you disable this exponential backoff algorithm. See also
1890\fI--retry-max-time\fP to limit the total time allowed for retries.
1891
1892If this option is used several times, the last one will be used.
1893
1894Added in 7.12.3.
1895.IP "--sasl-ir"
1896Enable initial response in SASL authentication.
1897
1898Added in 7.31.0.
1899.IP "--service-name <name>"
1900This option allows you to change the service name for SPNEGO.
1901
1902Examples: \fI--negotiate\fP \fI--service-name\fP sockd would use sockd/server-name.
1903
1904Added in 7.43.0.
1905.IP "-S, --show-error"
1906When used with \fI-s, --silent\fP, it makes curl show an error message if it fails.
1907.IP "-s, --silent"
1908Silent or quiet mode. Don't show progress meter or error messages. Makes Curl
1909mute. It will still output the data you ask for, potentially even to the
1910terminal/stdout unless you redirect it.
1911
1912Use \fI-S, --show-error\fP in addition to this option to disable progress meter but
1913still show error messages.
1914
1915See also \fI-v, --verbose\fP and \fI--stderr\fP.
1916.IP "--socks4 <host[:port]>"
1917Use the specified SOCKS4 proxy. If the port number is not specified, it is
1918assumed at port 1080.
1919
1920This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually
1921exclusive.
1922
1923Since 7.21.7, this option is superfluous since you can specify a socks4 proxy
1924with \fI-x, --proxy\fP using a socks4:// protocol prefix.
1925
1926Since 7.52.0, \fI--preproxy\fP can be used to specify a SOCKS proxy at the same time
1927\fI-x, --proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
1928the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
1929
1930If this option is used several times, the last one will be used.
1931
1932Added in 7.15.2.
1933.IP "--socks4a <host[:port]>"
1934Use the specified SOCKS4a proxy. If the port number is not specified, it is
1935assumed at port 1080.
1936
1937This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually
1938exclusive.
1939
1940Since 7.21.7, this option is superfluous since you can specify a socks4a proxy
1941with \fI-x, --proxy\fP using a socks4a:// protocol prefix.
1942
1943Since 7.52.0, \fI--preproxy\fP can be used to specify a SOCKS proxy at the same time
1944\fI-x, --proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
1945the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
1946
1947If this option is used several times, the last one will be used.
1948
1949Added in 7.18.0.
1950.IP "--socks5-gssapi-nec"
1951As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961
1952says in section 4.3/4.4 it should be protected, but the NEC reference
1953implementation does not. The option \fI--socks5-gssapi-nec\fP allows the
1954unprotected exchange of the protection mode negotiation.
1955
1956Added in 7.19.4.
1957.IP "--socks5-gssapi-service <name>"
1958The default service name for a socks server is rcmd/server-fqdn. This option
1959allows you to change it.
1960
1961Examples: \fI--socks5\fP proxy-name \fI--socks5-gssapi-service\fP sockd would use
1962sockd/proxy-name \fI--socks5\fP proxy-name \fI--socks5-gssapi-service\fP sockd/real-name
1963would use sockd/real-name for cases where the proxy-name does not match the
1964principal name.
1965
1966Added in 7.19.4.
1967.IP "--socks5-hostname <host[:port]>"
1968Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If
1969the port number is not specified, it is assumed at port 1080.
1970
1971This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually
1972exclusive.
1973
1974Since 7.21.7, this option is superfluous since you can specify a socks5
1975hostname proxy with \fI-x, --proxy\fP using a socks5h:// protocol prefix.
1976
1977Since 7.52.0, \fI--preproxy\fP can be used to specify a SOCKS proxy at the same time
1978\fI-x, --proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
1979the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
1980
1981If this option is used several times, the last one will be used.
1982
1983Added in 7.18.0.
1984.IP "--socks5 <host[:port]>"
1985Use the specified SOCKS5 proxy - but resolve the host name locally. If the
1986port number is not specified, it is assumed at port 1080.
1987
1988This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually
1989exclusive.
1990
1991Since 7.21.7, this option is superfluous since you can specify a socks5 proxy
1992with \fI-x, --proxy\fP using a socks5:// protocol prefix.
1993
1994Since 7.52.0, \fI--preproxy\fP can be used to specify a SOCKS proxy at the same time
1995\fI-x, --proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
1996the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
1997
1998If this option is used several times, the last one will be used.
1999
2000This option (as well as \fI--socks4\fP) does not work with IPV6, FTPS or LDAP.
2001
2002Added in 7.18.0.
2003.IP "-Y, --speed-limit <speed>"
2004If a download is slower than this given speed (in bytes per second) for
2005speed-time seconds it gets aborted. speed-time is set with \fI-y, --speed-time\fP and is
200630 if not set.
2007
2008If this option is used several times, the last one will be used.
2009.IP "-y, --speed-time <seconds>"
2010If a download is slower than speed-limit bytes per second during a speed-time
2011period, the download gets aborted. If speed-time is used, the default
2012speed-limit will be 1 unless set with \fI-Y, --speed-limit\fP.
2013
2014This option controls transfers and thus will not affect slow connects etc. If
2015this is a concern for you, try the \fI--connect-timeout\fP option.
2016
2017If this option is used several times, the last one will be used.
2018.IP "--ssl-allow-beast"
2019This option tells curl to not work around a security flaw in the SSL3 and
2020TLS1.0 protocols known as BEAST. If this option isn't used, the SSL layer may
2021use workarounds known to cause interoperability problems with some older SSL
2022implementations. WARNING: this option loosens the SSL security, and by using
2023this flag you ask for exactly that.
2024
2025Added in 7.25.0.
2026.IP "--ssl-no-revoke"
2027(WinSSL) This option tells curl to disable certificate revocation checks.
2028WARNING: this option loosens the SSL security, and by using this flag you ask
2029for exactly that.
2030
2031Added in 7.44.0.
2032.IP "--ssl-reqd"
2033(FTP IMAP POP3 SMTP) Require SSL/TLS for the connection. Terminates the connection if the server
2034doesn't support SSL/TLS.
2035
2036This option was formerly known as --ftp-ssl-reqd.
2037
2038Added in 7.20.0.
2039.IP "--ssl"
2040(FTP IMAP POP3 SMTP)
2041Try to use SSL/TLS for the connection. Reverts to a non-secure connection if
2042the server doesn't support SSL/TLS. See also \fI--ftp-ssl-control\fP and \fI--ssl-reqd\fP
2043for different levels of encryption required.
2044
2045This option was formerly known as --ftp-ssl (Added in 7.11.0). That option
2046name can still be used but will be removed in a future version.
2047
2048Added in 7.20.0.
2049.IP "-2, --sslv2"
2050(SSL) Forces curl to use SSL version 2 when negotiating with a remote SSL
2051server. Sometimes curl is built without SSLv2 support. SSLv2 is widely
2052considered insecure (see RFC 6176).
2053
2054See also \fI--http1.1\fP and \fI--http2\fP. \fI-2, --sslv2\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI-3, --sslv3\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP.
2055.IP "-3, --sslv3"
2056(SSL) Forces curl to use SSL version 3 when negotiating with a remote SSL
2057server. Sometimes curl is built without SSLv3 support. SSLv3 is widely
2058considered insecure (see RFC 7568).
2059
2060See also \fI--http1.1\fP and \fI--http2\fP. \fI-3, --sslv3\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI-2, --sslv2\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP.
2061.IP "--stderr"
2062Redirect all writes to stderr to the specified file instead. If the file name
2063is a plain '-', it is instead written to stdout.
2064
2065If this option is used several times, the last one will be used.
2066
2067See also \fI-v, --verbose\fP and \fI-s, --silent\fP.
2068.IP "--suppress-connect-headers"
2069When \fI-p, --proxytunnel\fP is used and a CONNECT request is made don't output proxy
2070CONNECT response headers. This option is meant to be used with \fI-D, --dump-header\fP or
2071\fI-i, --include\fP which are used to show protocol headers in the output. It has no
2072effect on debug options such as \fI-v, --verbose\fP or \fI--trace\fP, or any statistics.
2073
2074See also \fI-D, --dump-header\fP and \fI-i, --include\fP and \fI-p, --proxytunnel\fP.
2075.IP "--tcp-fastopen"
2076Enable use of TCP Fast Open (RFC7413).
2077
2078Added in 7.49.0.
2079.IP "--tcp-nodelay"
2080Turn on the TCP_NODELAY option. See the \fIcurl_easy_setopt(3)\fP man page for
2081details about this option.
2082
2083Since 7.50.2, curl sets this option by default and you need to explicitly
2084switch it off if you don't want it on.
2085
2086Added in 7.11.2.
2087.IP "-t, --telnet-option <opt=val>"
2088Pass options to the telnet protocol. Supported options are:
2089
2090TTYPE=<term> Sets the terminal type.
2091
2092XDISPLOC=<X display> Sets the X display location.
2093
2094NEW_ENV=<var,val> Sets an environment variable.
2095.IP "--tftp-blksize <value>"
2096(TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will
2097try to use when transferring data to or from a TFTP server. By default 512
2098bytes will be used.
2099
2100If this option is used several times, the last one will be used.
2101
2102Added in 7.20.0.
2103.IP "--tftp-no-options"
2104(TFTP) Tells curl not to send TFTP options requests.
2105
2106This option improves interop with some legacy servers that do not acknowledge
2107or properly implement TFTP options. When this option is used \fI--tftp-blksize\fP is
2108ignored.
2109
2110Added in 7.48.0.
2111.IP "-z, --time-cond <time>"
2112(HTTP FTP) Request a file that has been modified later than the given time and date, or
2113one that has been modified before that time. The <date expression> can be all
2114sorts of date strings or if it doesn't match any internal ones, it is taken as
2115a filename and tries to get the modification date (mtime) from <file>
2116instead. See the \fIcurl_getdate(3)\fP man pages for date expression details.
2117
2118Start the date expression with a dash (-) to make it request for a document
2119that is older than the given date/time, default is a document that is newer
2120than the specified date/time.
2121
2122If this option is used several times, the last one will be used.
2123.IP "--tls-max <VERSION>"
2124(SSL) VERSION defines maximum supported TLS version. A minimum is defined
2125by arguments tlsv1.0 or tlsv1.1 or tlsv1.2.
2126
2127.RS
2128.IP "default"
2129Use up to recommended TLS version.
2130.IP "1.0"
2131Use up to TLSv1.0.
2132.IP "1.1"
2133Use up to TLSv1.1.
2134.IP "1.2"
2135Use up to TLSv1.2.
2136.IP "1.3"
2137Use up to TLSv1.3.
2138.RE
2139
2140See also \fI--tlsv1.0\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP. \fI--tls-max\fP requires that the underlying libcurl was built to support TLS. Added in 7.54.0.
2141.IP "--tlsauthtype <type>"
2142Set TLS authentication type. Currently, the only supported option is "SRP",
2143for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are specified but
2144\fI--tlsauthtype\fP is not, then this option defaults to "SRP".
2145
2146Added in 7.21.4.
2147.IP "--tlspassword"
2148Set password for use with the TLS authentication method specified with
2149\fI--tlsauthtype\fP. Requires that \fI--tlsuser\fP also be set.
2150
2151Added in 7.21.4.
2152.IP "--tlsuser <name>"
2153Set username for use with the TLS authentication method specified with
2154\fI--tlsauthtype\fP. Requires that \fI--tlspassword\fP also is set.
2155
2156Added in 7.21.4.
2157.IP "--tlsv1.0"
2158(TLS) Forces curl to use TLS version 1.0 when connecting to a remote TLS server.
2159
2160Added in 7.34.0.
2161.IP "--tlsv1.1"
2162(TLS) Forces curl to use TLS version 1.1 when connecting to a remote TLS server.
2163
2164Added in 7.34.0.
2165.IP "--tlsv1.2"
2166(TLS) Forces curl to use TLS version 1.2 when connecting to a remote TLS server.
2167
2168Added in 7.34.0.
2169.IP "--tlsv1.3"
2170(TLS) Forces curl to use TLS version 1.3 when connecting to a remote TLS server.
2171
2172Note that TLS 1.3 is only supported by a subset of TLS backends. At the time
2173of writing this, those are BoringSSL and NSS only.
2174
2175Added in 7.52.0.
2176.IP "-1, --tlsv1"
2177(SSL) Tells curl to use TLS version 1.x when negotiating with a remote TLS
2178server. That means TLS version 1.0, 1.1 or 1.2.
2179
2180See also \fI--http1.1\fP and \fI--http2\fP. \fI-1, --tlsv1\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI--tlsv1.1\fP and \fI--tlsv1.2\fP and \fI--tlsv1.3\fP.
2181.IP "--tr-encoding"
2182(HTTP) Request a compressed Transfer-Encoding response using one of the algorithms
2183curl supports, and uncompress the data while receiving it.
2184
2185Added in 7.21.6.
2186.IP "--trace-ascii <file>"
2187Enables a full trace dump of all incoming and outgoing data, including
2188descriptive information, to the given output file. Use "-" as filename to have
2189the output sent to stdout.
2190
2191This is very similar to \fI--trace\fP, but leaves out the hex part and only shows
2192the ASCII part of the dump. It makes smaller output that might be easier to
2193read for untrained humans.
2194
2195If this option is used several times, the last one will be used.
2196
2197This option overrides \fI--trace\fP and \fI-v, --verbose\fP.
2198.IP "--trace-time"
2199Prepends a time stamp to each trace or verbose line that curl displays.
2200
2201Added in 7.14.0.
2202.IP "--trace <file>"
2203Enables a full trace dump of all incoming and outgoing data, including
2204descriptive information, to the given output file. Use "-" as filename to have
2205the output sent to stdout. Use "%" as filename to have the output sent to
2206stderr.
2207
2208If this option is used several times, the last one will be used.
2209
2210This option overrides \fI-v, --verbose\fP and \fI--trace-ascii\fP.
2211.IP "--unix-socket <path>"
2212(HTTP) Connect through this Unix domain socket, instead of using the network.
2213
2214Added in 7.40.0.
2215.IP "-T, --upload-file <file>"
2216This transfers the specified local file to the remote URL. If there is no file
2217part in the specified URL, curl will append the local file name. NOTE that you
2218must use a trailing / on the last directory to really prove to Curl that there
2219is no file name or curl will think that your last directory name is the remote
2220file name to use. That will most likely cause the upload operation to fail. If
2221this is used on an HTTP(S) server, the PUT command will be used.
2222
2223Use the file name "-" (a single dash) to use stdin instead of a given file.
2224Alternately, the file name "." (a single period) may be specified instead
2225of "-" to use stdin in non-blocking mode to allow reading server output
2226while stdin is being uploaded.
2227
2228You can specify one \fI-T, --upload-file\fP for each URL on the command line. Each
2229\fI-T, --upload-file\fP + URL pair specifies what to upload and to where. curl also
2230supports "globbing" of the \fI-T, --upload-file\fP argument, meaning that you can upload
2231multiple files to a single URL by using the same URL globbing style supported
2232in the URL, like this:
2233
2234 curl --upload-file "{file1,file2}" http://www.example.com
2235
2236or even
2237
2238 curl -T "img[1-1000].png" ftp://ftp.example.com/upload/
2239
2240When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
2241formatted. It has to feature the necessary set of headers and mail body
2242formatted correctly by the user as curl will not transcode nor encode it
2243further in any way.
2244.IP "--url <url>"
2245Specify a URL to fetch. This option is mostly handy when you want to specify
2246URL(s) in a config file.
2247
2248If the given URL is missing a scheme name (such as "http://" or "ftp://" etc)
2249then curl will make a guess based on the host. If the outermost sub-domain
2250name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be
2251used, otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by
2252setting a default protocol, see \fI--proto-default\fP for details.
2253
2254This option may be used any number of times. To control where this URL is
2255written, use the \fI-o, --output\fP or the \fI-O, --remote-name\fP options.
2256.IP "-B, --use-ascii"
2257(FTP LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using a URL that
2258ends with ";type=A". This option causes data sent to stdout to be in text mode
2259for win32 systems.
2260.IP "-A, --user-agent <name>"
2261(HTTP)
2262Specify the User-Agent string to send to the HTTP server. To encode blanks in
2263the string, surround the string with single quote marks. This can also be set
2264with the \fI-H, --header\fP option of course.
2265
2266If this option is used several times, the last one will be used.
2267.IP "-u, --user <user:password>"
2268Specify the user name and password to use for server authentication. Overrides
2269\fI-n, --netrc\fP and \fI--netrc-optional\fP.
2270
2271If you simply specify the user name, curl will prompt for a password.
2272
2273The user name and passwords are split up on the first colon, which makes it
2274impossible to use a colon in the user name with this option. The password can,
2275still.
2276
2277When using Kerberos V5 with a Windows based server you should include the
2278Windows domain name in the user name, in order for the server to successfully
2279obtain a Kerberos Ticket. If you don't then the initial authentication
2280handshake may fail.
2281
2282When using NTLM, the user name can be specified simply as the user name,
2283without the domain, if there is a single domain and forest in your setup
2284for example.
2285
2286To specify the domain name use either Down-Level Logon Name or UPN (User
2287Principal Name) formats. For example, EXAMPLE\\user and user@example.com
2288respectively.
2289
2290If you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
2291Negotiate, NTLM or Digest authentication then you can tell curl to select
2292the user name and password from your environment by specifying a single colon
2293with this option: "-u :".
2294
2295If this option is used several times, the last one will be used.
2296.IP "-v, --verbose"
2297Makes curl verbose during the operation. Useful for debugging and seeing
2298what's going on "under the hood". A line starting with '>' means "header data"
2299sent by curl, '<' means "header data" received by curl that is hidden in
2300normal cases, and a line starting with '*' means additional info provided by
2301curl.
2302
2303If you only want HTTP headers in the output, \fI-i, --include\fP might be the option
2304you're looking for.
2305
2306If you think this option still doesn't give you enough details, consider using
2307\fI--trace\fP or \fI--trace-ascii\fP instead.
2308
2309Use \fI-s, --silent\fP to make curl really quiet.
2310
2311See also \fI-i, --include\fP. This option overrides \fI--trace\fP and \fI--trace-ascii\fP.
2312.IP "-V, --version"
2313Displays information about curl and the libcurl version it uses.
2314
2315The first line includes the full version of curl, libcurl and other 3rd party
2316libraries linked with the executable.
2317
2318The second line (starts with "Protocols:") shows all protocols that libcurl
2319reports to support.
2320
2321The third line (starts with "Features:") shows specific features libcurl
2322reports to offer. Available features include:
2323.RS
2324.IP "IPv6"
2325You can use IPv6 with this.
2326.IP "krb4"
2327Krb4 for FTP is supported.
2328.IP "SSL"
2329SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S
2330and so on.
2331.IP "libz"
2332Automatic decompression of compressed files over HTTP is supported.
2333.IP "NTLM"
2334NTLM authentication is supported.
2335.IP "Debug"
2336This curl uses a libcurl built with Debug. This enables more error-tracking
2337and memory debugging etc. For curl-developers only!
2338.IP "AsynchDNS"
2339This curl uses asynchronous name resolves. Asynchronous name resolves can be
2340done using either the c-ares or the threaded resolver backends.
2341.IP "SPNEGO"
2342SPNEGO authentication is supported.
2343.IP "Largefile"
2344This curl supports transfers of large files, files larger than 2GB.
2345.IP "IDN"
2346This curl supports IDN - international domain names.
2347.IP "GSS-API"
2348GSS-API is supported.
2349.IP "SSPI"
2350SSPI is supported.
2351.IP "TLS-SRP"
2352SRP (Secure Remote Password) authentication is supported for TLS.
2353.IP "HTTP2"
2354HTTP/2 support has been built-in.
2355.IP "UnixSockets"
2356Unix sockets support is provided.
2357.IP "HTTPS-proxy"
2358This curl is built to support HTTPS proxy.
2359.IP "Metalink"
2360This curl supports Metalink (both version 3 and 4 (RFC 5854)), which
2361describes mirrors and hashes. curl will use mirrors for failover if
2362there are errors (such as the file or server not being available).
2363.IP "PSL"
2364PSL is short for Public Suffix List and means that this curl has been built
2365with knowledge about "public suffixes".
2366.RE
2367.IP "-w, --write-out <format>"
2368Make curl display information on stdout after a completed transfer. The format
2369is a string that may contain plain text mixed with any number of
2370variables. The format can be specified as a literal "string", or you can have
2371curl read the format from a file with "@filename" and to tell curl to read the
2372format from stdin you write "@-".
2373
2374The variables present in the output format will be substituted by the value or
2375text that curl thinks fit, as described below. All variables are specified as
2376%{variable_name} and to output a normal % you just write them as %%. You can
2377output a newline by using \\n, a carriage return with \\r and a tab space with
2378\\t.
2379
2380.B NOTE:
2381The %-symbol is a special symbol in the win32-environment, where all
2382occurrences of % must be doubled when using this option.
2383
2384The variables available are:
2385.RS
2386.TP 15
2387.B content_type
2388The Content-Type of the requested document, if there was any.
2389.TP
2390.B filename_effective
2391The ultimate filename that curl writes out to. This is only meaningful if curl
2392is told to write to a file with the \fI-O, --remote-name\fP or \fI-o, --output\fP
2393option. It's most useful in combination with the \fI-J, --remote-header-name\fP
2394option. (Added in 7.26.0)
2395.TP
2396.B ftp_entry_path
2397The initial path curl ended up in when logging on to the remote FTP
2398server. (Added in 7.15.4)
2399.TP
2400.B http_code
2401The numerical response code that was found in the last retrieved HTTP(S) or
2402FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the
2403same info.
2404.TP
2405.B http_connect
2406The numerical code that was found in the last response (from a proxy) to a
2407curl CONNECT request. (Added in 7.12.4)
2408.TP
2409.B http_version
2410The http version that was effectively used. (Added in 7.50.0)
2411.TP
2412.B local_ip
2413The IP address of the local end of the most recently done connection - can be
2414either IPv4 or IPv6 (Added in 7.29.0)
2415.TP
2416.B local_port
2417The local port number of the most recently done connection (Added in 7.29.0)
2418.TP
2419.B num_connects
2420Number of new connects made in the recent transfer. (Added in 7.12.3)
2421.TP
2422.B num_redirects
2423Number of redirects that were followed in the request. (Added in 7.12.3)
2424.TP
2425.B proxy_ssl_verify_result
2426The result of the HTTPS proxy's SSL peer certificate verification that was
2427requested. 0 means the verification was successful. (Added in 7.52.0)
2428.TP
2429.B redirect_url
2430When an HTTP request was made without \fI-L, --location\fP to follow redirects (or when
2431--max-redir is met), this variable will show the actual URL a redirect
2432\fIwould\fP have gone to. (Added in 7.18.2)
2433.TP
2434.B remote_ip
2435The remote IP address of the most recently done connection - can be either
2436IPv4 or IPv6 (Added in 7.29.0)
2437.TP
2438.B remote_port
2439The remote port number of the most recently done connection (Added in 7.29.0)
2440.TP
2441.B scheme
2442The URL scheme (sometimes called protocol) that was effectively used (Added in 7.52.0)
2443.TP
2444.B size_download
2445The total amount of bytes that were downloaded.
2446.TP
2447.B size_header
2448The total amount of bytes of the downloaded headers.
2449.TP
2450.B size_request
2451The total amount of bytes that were sent in the HTTP request.
2452.TP
2453.B size_upload
2454The total amount of bytes that were uploaded.
2455.TP
2456.B speed_download
2457The average download speed that curl measured for the complete download. Bytes
2458per second.
2459.TP
2460.B speed_upload
2461The average upload speed that curl measured for the complete upload. Bytes per
2462second.
2463.TP
2464.B ssl_verify_result
2465The result of the SSL peer certificate verification that was requested. 0
2466means the verification was successful. (Added in 7.19.0)
2467.TP
2468.B time_appconnect
2469The time, in seconds, it took from the start until the SSL/SSH/etc
2470connect/handshake to the remote host was completed. (Added in 7.19.0)
2471.TP
2472.B time_connect
2473The time, in seconds, it took from the start until the TCP connect to the
2474remote host (or proxy) was completed.
2475.TP
2476.B time_namelookup
2477The time, in seconds, it took from the start until the name resolving was
2478completed.
2479.TP
2480.B time_pretransfer
2481The time, in seconds, it took from the start until the file transfer was just
2482about to begin. This includes all pre-transfer commands and negotiations that
2483are specific to the particular protocol(s) involved.
2484.TP
2485.B time_redirect
2486The time, in seconds, it took for all redirection steps including name lookup,
2487connect, pretransfer and transfer before the final transaction was
2488started. time_redirect shows the complete execution time for multiple
2489redirections. (Added in 7.12.3)
2490.TP
2491.B time_starttransfer
2492The time, in seconds, it took from the start until the first byte was just
2493about to be transferred. This includes time_pretransfer and also the time the
2494server needed to calculate the result.
2495.TP
2496.B time_total
2497The total time, in seconds, that the full operation lasted.
2498.TP
2499.B url_effective
2500The URL that was fetched last. This is most meaningful if you've told curl
2501to follow location: headers.
2502.RE
2503.IP
2504If this option is used several times, the last one will be used.
2505.IP "--xattr"
2506When saving output to a file, this option tells curl to store certain file
2507metadata in extended file attributes. Currently, the URL is stored in the
2508xdg.origin.url attribute and, for HTTP, the content type is stored in
2509the mime_type attribute. If the file system does not support extended
2510attributes, a warning is issued.
2511.SH FILES
2512.I ~/.curlrc
2513.RS
2514Default config file, see \fI-K, --config\fP for details.
2515.SH ENVIRONMENT
2516The environment variables can be specified in lower case or upper case. The
2517lower case version has precedence. http_proxy is an exception as it is only
2518available in lower case.
2519
2520Using an environment variable to set the proxy has the same effect as using
2521the \fI-x, --proxy\fP option.
2522
2523.IP "http_proxy [protocol://]<host>[:port]"
2524Sets the proxy server to use for HTTP.
2525.IP "HTTPS_PROXY [protocol://]<host>[:port]"
2526Sets the proxy server to use for HTTPS.
2527.IP "[url-protocol]_PROXY [protocol://]<host>[:port]"
2528Sets the proxy server to use for [url-protocol], where the protocol is a
2529protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP,
2530SMTP, LDAP etc.
2531.IP "ALL_PROXY [protocol://]<host>[:port]"
2532Sets the proxy server to use if no protocol-specific proxy is set.
2533.IP "NO_PROXY <comma-separated list of hosts>"
2534list of host names that shouldn't go through any proxy. If set to a asterisk
2535\&'*' only, it matches all hosts.
2536
2537Since 7.53.0, this environment variable disable the proxy even if specify
2538\fI-x, --proxy\fP option. That is
2539.B NO_PROXY=direct.example.com curl -x http://proxy.example.com
2540.B http://direct.example.com
2541accesses the target URL directly, and
2542.B NO_PROXY=direct.example.com curl -x http://proxy.example.com
2543.B http://somewhere.example.com
2544accesses the target URL through proxy.
2545
2546.SH "PROXY PROTOCOL PREFIXES"
2547Since curl version 7.21.7, the proxy string may be specified with a
2548protocol:// prefix to specify alternative proxy protocols.
2549
2550If no protocol is specified in the proxy string or if the string doesn't match
2551a supported one, the proxy will be treated as an HTTP proxy.
2552
2553The supported proxy protocol prefixes are as follows:
2554.IP "socks4://"
2555Makes it the equivalent of \fI--socks4\fP
2556.IP "socks4a://"
2557Makes it the equivalent of \fI--socks4a\fP
2558.IP "socks5://"
2559Makes it the equivalent of \fI--socks5\fP
2560.IP "socks5h://"
2561Makes it the equivalent of \fI--socks5-hostname\fP
2562.SH EXIT CODES
2563There are a bunch of different error codes and their corresponding error
2564messages that may appear during bad conditions. At the time of this writing,
2565the exit codes are:
2566.IP 1
2567Unsupported protocol. This build of curl has no support for this protocol.
2568.IP 2
2569Failed to initialize.
2570.IP 3
2571URL malformed. The syntax was not correct.
2572.IP 4
2573A feature or option that was needed to perform the desired request was not
2574enabled or was explicitly disabled at build-time. To make curl able to do
2575this, you probably need another build of libcurl!
2576.IP 5
2577Couldn't resolve proxy. The given proxy host could not be resolved.
2578.IP 6
2579Couldn't resolve host. The given remote host was not resolved.
2580.IP 7
2581Failed to connect to host.
2582.IP 8
2583Weird server reply. The server sent data curl couldn't parse.
2584.IP 9
2585FTP access denied. The server denied login or denied access to the particular
2586resource or directory you wanted to reach. Most often you tried to change to a
2587directory that doesn't exist on the server.
2588.IP 10
2589FTP accept failed. While waiting for the server to connect back when an active
2590FTP session is used, an error code was sent over the control connection or
2591similar.
2592.IP 11
2593FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request.
2594.IP 12
2595During an active FTP session while waiting for the server to connect back to
2596curl, the timeout expired.
2597.IP 13
2598FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request.
2599.IP 14
2600FTP weird 227 format. Curl couldn't parse the 227-line the server sent.
2601.IP 15
2602FTP can't get host. Couldn't resolve the host IP we got in the 227-line.
2603.IP 16
2604HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is
2605somewhat generic and can be one out of several problems, see the error message
2606for details.
2607.IP 17
2608FTP couldn't set binary. Couldn't change transfer method to binary.
2609.IP 18
2610Partial file. Only a part of the file was transferred.
2611.IP 19
2612FTP couldn't download/access the given file, the RETR (or similar) command
2613failed.
2614.IP 21
2615FTP quote error. A quote command returned error from the server.
2616.IP 22
2617HTTP page not retrieved. The requested url was not found or returned another
2618error with the HTTP error code being 400 or above. This return code only
2619appears if \fI-f, --fail\fP is used.
2620.IP 23
2621Write error. Curl couldn't write data to a local filesystem or similar.
2622.IP 25
2623FTP couldn't STOR file. The server denied the STOR operation, used for FTP
2624uploading.
2625.IP 26
2626Read error. Various reading problems.
2627.IP 27
2628Out of memory. A memory allocation request failed.
2629.IP 28
2630Operation timeout. The specified time-out period was reached according to the
2631conditions.
2632.IP 30
2633FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT
2634command, try doing a transfer using PASV instead!
2635.IP 31
2636FTP couldn't use REST. The REST command failed. This command is used for
2637resumed FTP transfers.
2638.IP 33
2639HTTP range error. The range "command" didn't work.
2640.IP 34
2641HTTP post error. Internal post-request generation error.
2642.IP 35
2643SSL connect error. The SSL handshaking failed.
2644.IP 36
2645Bad download resume. Couldn't continue an earlier aborted download.
2646.IP 37
2647FILE couldn't read file. Failed to open the file. Permissions?
2648.IP 38
2649LDAP cannot bind. LDAP bind operation failed.
2650.IP 39
2651LDAP search failed.
2652.IP 41
2653Function not found. A required LDAP function was not found.
2654.IP 42
2655Aborted by callback. An application told curl to abort the operation.
2656.IP 43
2657Internal error. A function was called with a bad parameter.
2658.IP 45
2659Interface error. A specified outgoing interface could not be used.
2660.IP 47
2661Too many redirects. When following redirects, curl hit the maximum amount.
2662.IP 48
2663Unknown option specified to libcurl. This indicates that you passed a weird
2664option to curl that was passed on to libcurl and rejected. Read up in the
2665manual!
2666.IP 49
2667Malformed telnet option.
2668.IP 51
2669The peer's SSL certificate or SSH MD5 fingerprint was not OK.
2670.IP 52
2671The server didn't reply anything, which here is considered an error.
2672.IP 53
2673SSL crypto engine not found.
2674.IP 54
2675Cannot set SSL crypto engine as default.
2676.IP 55
2677Failed sending network data.
2678.IP 56
2679Failure in receiving network data.
2680.IP 58
2681Problem with the local certificate.
2682.IP 59
2683Couldn't use specified SSL cipher.
2684.IP 60
2685Peer certificate cannot be authenticated with known CA certificates.
2686.IP 61
2687Unrecognized transfer encoding.
2688.IP 62
2689Invalid LDAP URL.
2690.IP 63
2691Maximum file size exceeded.
2692.IP 64
2693Requested FTP SSL level failed.
2694.IP 65
2695Sending the data requires a rewind that failed.
2696.IP 66
2697Failed to initialise SSL Engine.
2698.IP 67
2699The user name, password, or similar was not accepted and curl failed to log in.
2700.IP 68
2701File not found on TFTP server.
2702.IP 69
2703Permission problem on TFTP server.
2704.IP 70
2705Out of disk space on TFTP server.
2706.IP 71
2707Illegal TFTP operation.
2708.IP 72
2709Unknown TFTP transfer ID.
2710.IP 73
2711File already exists (TFTP).
2712.IP 74
2713No such user (TFTP).
2714.IP 75
2715Character conversion failed.
2716.IP 76
2717Character conversion functions required.
2718.IP 77
2719Problem with reading the SSL CA cert (path? access rights?).
2720.IP 78
2721The resource referenced in the URL does not exist.
2722.IP 79
2723An unspecified error occurred during the SSH session.
2724.IP 80
2725Failed to shut down the SSL connection.
2726.IP 82
2727Could not load CRL file, missing or wrong format (added in 7.19.0).
2728.IP 83
2729Issuer check failed (added in 7.19.0).
2730.IP 84
2731The FTP PRET command failed
2732.IP 85
2733RTSP: mismatch of CSeq numbers
2734.IP 86
2735RTSP: mismatch of Session Identifiers
2736.IP 87
2737unable to parse FTP file list
2738.IP 88
2739FTP chunk callback reported error
2740.IP 89
2741No connection available, the session will be queued
2742.IP 90
2743SSL public key does not matched pinned public key
2744.IP XX
2745More error codes will appear here in future releases. The existing ones
2746are meant to never change.
2747.SH AUTHORS / CONTRIBUTORS
2748Daniel Stenberg is the main author, but the whole list of contributors is
2749found in the separate THANKS file.
2750.SH WWW
2751https://curl.haxx.se
2752.SH "SEE ALSO"
2753.BR ftp (1),
2754.BR wget (1)