blob: 18d2cf07c5f4ac2924106c2238e0525efeea7eeb [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001.\" **************************************************************************
2.\" * _ _ ____ _
3.\" * Project ___| | | | _ \| |
4.\" * / __| | | | |_) | |
5.\" * | (__| |_| | _ <| |___
6.\" * \___|\___/|_| \_\_____|
7.\" *
8.\" * Copyright (C) 1998 \- 2022, 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.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.\" * SPDX-License-Identifier: curl
22.\" *
23.\" **************************************************************************
24.\"
25.\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
26.\"
27.TH curl 1 "October 23 2022" "curl 7.86.0" "curl Manual"
28.SH NAME
29curl \- transfer a URL
30.SH SYNOPSIS
31.B curl [options / URLs]
32.SH DESCRIPTION
33\fBcurl\fP is a tool for transferring data from or to a server. It supports these
34protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS,
35LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP,
36SMTPS, TELNET, TFTP, WS and WSS. The command is designed to work without user
37interaction.
38
39curl offers a busload of useful tricks like proxy support, user
40authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
41resume and more. As you will see below, the number of features will make your
42head 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 find a detailed description in
48RFC 3986.
49
50You can specify multiple URLs or parts of URLs by writing part sets within
51braces and quoting the URL as in:
52
53.nf
54 \(dqhttp://site.{one,two,three}.com"
55.fi
56
57or you can get sequences of alphanumeric series by using [] as in:
58
59.nf
60 \(dqftp://ftp.example.com/file[1-100].txt"
61.fi
62
63.nf
64 \(dqftp://ftp.example.com/file[001-100].txt" (with leading zeros)
65.fi
66
67.nf
68 \(dqftp://ftp.example.com/file[a-z].txt"
69.fi
70
71Nested sequences are not supported, but you can use several ones next to each
72other:
73
74.nf
75 \(dqhttp://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html"
76.fi
77
78You can specify any amount of URLs on the command line. They will be fetched
79in a sequential manner in the specified order. You can specify command line
80options and URLs mixed and in any order on the command line.
81
82You can specify a step counter for the ranges to get every Nth number or
83letter:
84
85.nf
86 \(dqhttp://example.com/file[1-100:10].txt"
87.fi
88
89.nf
90 \(dqhttp://example.com/file[a-z:2].txt"
91.fi
92
93When using [] or {} sequences when invoked from a command line prompt, you
94probably have to put the full URL within double quotes to avoid the shell from
95interfering with it. This also goes for other characters treated special, like
96for example '&', '?' and '*'.
97
98Provide the IPv6 zone index in the URL with an escaped percentage sign and the
99interface name. Like in
100
101.nf
102 \(dqhttp://[fe80::3%25eth0]/"
103.fi
104
105If you specify URL without protocol:// prefix, curl will attempt to guess what
106protocol you might want. It will then default to HTTP but try other protocols
107based on often-used host name prefixes. For example, for host names starting
108with "ftp." curl will assume you want to speak FTP.
109
110curl will do its best to use what you pass to it as a URL. It is not trying to
111validate it as a syntactically correct URL by any means but is fairly liberal
112with what it accepts.
113
114curl will attempt to re-use connections for multiple file transfers, so that
115getting many files from the same server will not do multiple connects /
116handshakes. This improves speed. Of course this is only done on files
117specified on a single command line and cannot be used between separate curl
118invocations.
119.SH OUTPUT
120If not told otherwise, curl writes the received data to stdout. It can be
121instructed to instead save that data into a local file, using the \-\-output or
122\-\-remote-name options. If curl is given multiple URLs to transfer on the
123command line, it similarly needs multiple options for where to save them.
124
125curl does not parse or otherwise "understand" the content it gets or writes as
126output. It does no encoding or decoding, unless explicitly asked to with
127dedicated command line options.
128.SH PROTOCOLS
129curl supports numerous protocols, or put in URL terms: schemes. Your
130particular build may not support them all.
131.IP DICT
132Lets you lookup words using online dictionaries.
133.IP FILE
134Read or write local files. curl does not support accessing file:// URL
135remotely, but when running on Microsoft Windows using the native UNC approach
136will work.
137.IP FTP(S)
138curl supports the File Transfer Protocol with a lot of tweaks and levers. With
139or without using TLS.
140.IP GOPHER(S)
141Retrieve files.
142.IP HTTP(S)
143curl supports HTTP with numerous options and variations. It can speak HTTP
144version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct
145command line options.
146.IP IMAP(S)
147Using the mail reading protocol, curl can "download" emails for you. With or
148without using TLS.
149.IP LDAP(S)
150curl can do directory lookups for you, with or without TLS.
151.IP MQTT
152curl supports MQTT version 3. Downloading over MQTT equals "subscribe" to a
153topic while uploading/posting equals "publish" on a topic. MQTT over TLS is
154not supported (yet).
155.IP POP3(S)
156Downloading from a pop3 server means getting a mail. With or without using
157TLS.
158.IP RTMP(S)
159The Realtime Messaging Protocol is primarily used to server streaming media
160and curl can download it.
161.IP RTSP
162curl supports RTSP 1.0 downloads.
163.IP SCP
164curl supports SSH version 2 scp transfers.
165.IP SFTP
166curl supports SFTP (draft 5) done over SSH version 2.
167.IP SMB(S)
168curl supports SMB version 1 for upload and download.
169.IP SMTP(S)
170Uploading contents to an SMTP server means sending an email. With or without
171TLS.
172.IP TELNET
173Telling curl to fetch a telnet URL starts an interactive session where it
174sends what it reads on stdin and outputs what the server sends it.
175.IP TFTP
176curl can do TFTP downloads and uploads.
177.SH "PROGRESS METER"
178curl normally displays a progress meter during operations, indicating the
179amount of transferred data, transfer speeds and estimated time left, etc. The
180progress meter displays number of bytes and the speeds are in bytes per
181second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024
182bytes. 1M is 1048576 bytes.
183
184curl displays this data to the terminal by default, so if you invoke curl to
185do an operation and it is about to write data to the terminal, it
186\fIdisables\fP the progress meter as otherwise it would mess up the output
187mixing progress meter and response data.
188
189If you want a progress meter for HTTP POST or PUT requests, you need to
190redirect the response output to a file, using shell redirect (>), \-\-output or
191similar.
192
193This does not apply to FTP upload as that operation does not spit out any
194response data to the terminal.
195
196If you prefer a progress "bar" instead of the regular meter, \-\-progress-bar is
197your friend. You can also disable the progress meter completely with the
198\-\-silent option.
199.SH OPTIONS
200Options start with one or two dashes. Many of the options require an
201additional value next to them.
202
203The short "single-dash" form of the options, \-d for example, may be used with
204or without a space between it and its value, although a space is a recommended
205separator. The long "double-dash" form, \-\-data for example, requires a space
206between it and its value.
207
208Short version options that do not need any additional values can be used
209immediately next to each other, like for example you can specify all the
210options \-O, \-L and \-v at once as \-OLv.
211
212In general, all boolean options are enabled with \-\-\fBoption\fP and yet again
213disabled with \-\-\fBno-\fPoption. That is, you use the same option name but
214prefix it with "no-". However, in this list we mostly only list and show the
215\-\-option version of them.
216.IP "\-\-abstract-unix-socket <path>"
217(HTTP) Connect through an abstract Unix domain socket, instead of using the network.
218Note: netstat shows the path of an abstract socket prefixed with '@', however
219the <path> argument should not have this leading character.
220
221If --abstract-unix-socket is provided several times, the last set value will be used.
222
223Example:
224.nf
225 curl --abstract-unix-socket socketpath https://example.com
226.fi
227
228See also \fI--unix-socket\fP. Added in 7.53.0.
229.IP "\-\-alt-svc <file name>"
230(HTTPS) This option enables the alt-svc parser in curl. If the file name points to an
231existing alt-svc cache file, that will be used. After a completed transfer,
232the cache will be saved to the file name again if it has been modified.
233
234Specify a "" file name (zero length) to avoid loading/saving and make curl
235just handle the cache in memory.
236
237If this option is used several times, curl will load contents from all the
238files but the last one will be used for saving.
239
240--alt-svc can be used several times in a command line
241
242Example:
243.nf
244 curl --alt-svc svc.txt https://example.com
245.fi
246
247See also \fI--resolve\fP and \fI--connect-to\fP. Added in 7.64.1.
248.IP "\-\-anyauth"
249(HTTP) Tells curl to figure out authentication method by itself, and use the most
250secure one the remote site claims to support. This is done by first doing a
251request and checking the response-headers, thus possibly inducing an extra
252network round-trip. This is used instead of setting a specific authentication
253method, which you can do with \fI\-\-basic\fP, \fI\-\-digest\fP, \fI\-\-ntlm\fP, and \fI\-\-negotiate\fP.
254
255Using \-\-anyauth is not recommended if you do uploads from stdin, since it may
256require data to be sent twice and then the client must be able to rewind. If
257the need should arise when uploading from stdin, the upload operation will
258fail.
259
260Used together with \fI\-u, \-\-user\fP.
261
262Providing --anyauth multiple times has no extra effect.
263
264Example:
265.nf
266 curl --anyauth --user me:pwd https://example.com
267.fi
268
269See also \fI--proxy-anyauth\fP, \fI--basic\fP and \fI--digest\fP.
270.IP "\-a, \-\-append"
271(FTP SFTP) When used in an upload, this makes curl append to the target file instead of
272overwriting it. If the remote file does not exist, it will be created. Note
273that this flag is ignored by some SFTP servers (including OpenSSH).
274
275Providing --append multiple times has no extra effect.
276Disable it again with --no-append.
277
278Example:
279.nf
280 curl --upload-file local --append ftp://example.com/
281.fi
282
283See also \fI-r, --range\fP and \fI-C, --continue-at\fP.
284.IP "\-\-aws-sigv4 <provider1[:provider2[:region[:service]]]>"
285Use AWS V4 signature authentication in the transfer.
286
287The provider argument is a string that is used by the algorithm when creating
288outgoing authentication headers.
289
290The region argument is a string that points to a geographic area of
291a resources collection (region-code) when the region name is omitted from
292the endpoint.
293
294The service argument is a string that points to a function provided by a cloud
295(service-code) when the service name is omitted from the endpoint.
296
297If --aws-sigv4 is provided several times, the last set value will be used.
298
299Example:
300.nf
301 curl --aws-sigv4 "aws:amz:east-2:es" --user "key:secret" https://example.com
302.fi
303
304See also \fI--basic\fP and \fI-u, --user\fP. Added in 7.75.0.
305.IP "\-\-basic"
306(HTTP) Tells curl to use HTTP Basic authentication with the remote host. This is the
307default and this option is usually pointless, unless you use it to override a
308previously set option that sets a different authentication method (such as
309\fI\-\-ntlm\fP, \fI\-\-digest\fP, or \fI\-\-negotiate\fP).
310
311Used together with \fI\-u, \-\-user\fP.
312
313Providing --basic multiple times has no extra effect.
314
315Example:
316.nf
317 curl -u name:password --basic https://example.com
318.fi
319
320See also \fI--proxy-basic\fP.
321.IP "\-\-cacert <file>"
322(TLS) Tells curl to use the specified certificate file to verify the peer. The file
323may contain multiple CA certificates. The certificate(s) must be in PEM
324format. Normally curl is built to use a default file for this, so this option
325is typically used to alter that default file.
326
327curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is
328set, and uses the given path as a path to a CA cert bundle. This option
329overrides that variable.
330
331The windows version of curl will automatically look for a CA certs file named
332\(aqcurl-ca-bundle.crt', either in the same directory as curl.exe, or in the
333Current Working Directory, or in any folder along your PATH.
334
335If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
336(libnsspem.so) needs to be available for this option to work properly.
337
338(iOS and macOS only) If curl is built against Secure Transport, then this
339option is supported for backward compatibility with other SSL engines, but it
340should not be set. If the option is not set, then curl will use the
341certificates in the system and user Keychain to verify the peer, which is the
342preferred method of verifying the peer's certificate chain.
343
344(Schannel only) This option is supported for Schannel in Windows 7 or later
345with libcurl 7.60 or later. This option is supported for backward
346compatibility with other SSL engines; instead it is recommended to use
347Windows' store of root certificates (the default for Schannel).
348
349If --cacert is provided several times, the last set value will be used.
350
351Example:
352.nf
353 curl --cacert CA-file.txt https://example.com
354.fi
355
356See also \fI--capath\fP and \fI-k, --insecure\fP.
357.IP "\-\-capath <dir>"
358(TLS) Tells curl to use the specified certificate directory to verify the
359peer. Multiple paths can be provided by separating them with ":" (e.g.
360\(dqpath1:path2:path3"). The certificates must be in PEM format, and if curl is
361built against OpenSSL, the directory must have been processed using the
362c_rehash utility supplied with OpenSSL. Using \-\-capath can allow
363OpenSSL-powered curl to make SSL-connections much more efficiently than using
364\-\-cacert if the \-\-cacert file contains many CA certificates.
365
366If this option is set, the default capath value will be ignored.
367
368If --capath is provided several times, the last set value will be used.
369
370Example:
371.nf
372 curl --capath /local/directory https://example.com
373.fi
374
375See also \fI--cacert\fP and \fI-k, --insecure\fP.
376.IP "\-\-cert-status"
377(TLS) Tells curl to verify the status of the server certificate by using the
378Certificate Status Request (aka. OCSP stapling) TLS extension.
379
380If this option is enabled and the server sends an invalid (e.g. expired)
381response, if the response suggests that the server certificate has been
382revoked, or no response at all is received, the verification fails.
383
384This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.
385
386Providing --cert-status multiple times has no extra effect.
387Disable it again with --no-cert-status.
388
389Example:
390.nf
391 curl --cert-status https://example.com
392.fi
393
394See also \fI--pinnedpubkey\fP. Added in 7.41.0.
395.IP "\-\-cert-type <type>"
396(TLS) Tells curl what type the provided client certificate is using. PEM, DER, ENG
397and P12 are recognized types.
398
399The default type depends on the TLS backend and is usually PEM, however for
400Secure Transport and Schannel it is P12. If \-\-cert is a pkcs11: URI then ENG is
401the default type.
402
403If --cert-type is provided several times, the last set value will be used.
404
405Example:
406.nf
407 curl --cert-type PEM --cert file https://example.com
408.fi
409
410See also \fI-E, --cert\fP, \fI--key\fP and \fI--key-type\fP.
411.IP "\-E, \-\-cert <certificate[:password]>"
412(TLS) Tells curl to use the specified client certificate file when getting a file
413with HTTPS, FTPS or another SSL-based protocol. The certificate must be in
414PKCS#12 format if using Secure Transport, or PEM format if using any other
415engine. If the optional password is not specified, it will be queried for on
416the terminal. Note that this option assumes a certificate file that is the
417private key and the client certificate concatenated. See \-\-cert and \-\-key to
418specify them independently.
419
420In the <certificate> portion of the argument, you must escape the character ":"
421as "\\:" so that it is not recognized as the password delimiter. Similarly, you
422must escape the character "\\" as "\\\\" so that it is not recognized as an
423escape character.
424
425If curl is built against the NSS SSL library then this option can tell
426curl the nickname of the certificate to use within the NSS database defined
427by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the
428NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be
429loaded.
430
431If you provide a path relative to the current directory, you must prefix the
432path with "./" in order to avoid confusion with an NSS database nickname.
433
434If curl is built against OpenSSL library, and the engine pkcs11 is available,
435then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in
436a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
437PKCS#11 URI. If a PKCS#11 URI is provided, then the \-\-engine option will be set
438as "pkcs11" if none was provided and the \-\-cert-type option will be set as
439\(dqENG" if none was provided.
440
441(iOS and macOS only) If curl is built against Secure Transport, then the
442certificate string can either be the name of a certificate/private key in the
443system or user keychain, or the path to a PKCS#12-encoded certificate and
444private key. If you want to use a file from the current directory, please
445precede it with "./" prefix, in order to avoid confusion with a nickname.
446
447(Schannel only) Client certificates must be specified by a path
448expression to a certificate store. (Loading PFX is not supported; you can
449import it to a store first). You can use
450\(dq<store location>\\<store name>\\<thumbprint>" to refer to a certificate
451in the system certificates store, for example,
452\(dqCurrentUser\\MY\\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a". Thumbprint is
453usually a SHA-1 hex string which you can see in certificate details. Following
454store locations are supported: CurrentUser, LocalMachine, CurrentService,
455Services, CurrentUserGroupPolicy, LocalMachineGroupPolicy,
456LocalMachineEnterprise.
457
458If --cert is provided several times, the last set value will be used.
459
460Example:
461.nf
462 curl --cert certfile --key keyfile https://example.com
463.fi
464
465See also \fI--cert-type\fP, \fI--key\fP and \fI--key-type\fP.
466.IP "\-\-ciphers <list of ciphers>"
467(TLS) Specifies which ciphers to use in the connection. The list of ciphers must
468specify valid ciphers. Read up on SSL cipher list details on this URL:
469
470.nf
471 https://curl.se/docs/ssl-ciphers.html
472.fi
473
474If --ciphers is provided several times, the last set value will be used.
475
476Example:
477.nf
478 curl --ciphers ECDHE-ECDSA-AES256-CCM8 https://example.com
479.fi
480
481See also \fI--tlsv1.3\fP.
482.IP "\-\-compressed-ssh"
483(SCP SFTP) Enables built-in SSH compression.
484This is a request, not an order; the server may or may not do it.
485
486Providing --compressed-ssh multiple times has no extra effect.
487Disable it again with --no-compressed-ssh.
488
489Example:
490.nf
491 curl --compressed-ssh sftp://example.com/
492.fi
493
494See also \fI--compressed\fP. Added in 7.56.0.
495.IP "\-\-compressed"
496(HTTP) Request a compressed response using one of the algorithms curl supports, and
497automatically decompress the content. Headers are not modified.
498
499If this option is used and the server sends an unsupported encoding, curl will
500report an error. This is a request, not an order; the server may or may not
501deliver data compressed.
502
503Providing --compressed multiple times has no extra effect.
504Disable it again with --no-compressed.
505
506Example:
507.nf
508 curl --compressed https://example.com
509.fi
510
511See also \fI--compressed-ssh\fP.
512.IP "\-K, \-\-config <file>"
513Specify a text file to read curl arguments from. The command line arguments
514found in the text file will be used as if they were provided on the command
515line.
516
517Options and their parameters must be specified on the same line in the file,
518separated by whitespace, colon, or the equals sign. Long option names can
519optionally be given in the config file without the initial double dashes and
520if so, the colon or equals characters can be used as separators. If the option
521is specified with one or two dashes, there can be no colon or equals character
522between the option and its parameter.
523
524If the parameter contains whitespace (or starts with : or =), the parameter
525must be enclosed within quotes. Within double quotes, the following escape
526sequences are available: \\\\, \\", \\t, \\n, \\r and \\v. A backslash
527preceding any other letter is ignored.
528
529If the first column of a config line is a '#' character, the rest of the line
530will be treated as a comment.
531
532Only write one option per physical line in the config file.
533
534Specify the filename to \-\-config as '-' to make curl read the file from stdin.
535
536Note that to be able to specify a URL in the config file, you need to specify
537it using the \-\-url option, and not by simply writing the URL on its own
538line. So, it could look similar to this:
539
540url = "https://curl.se/docs/"
541
542.nf
543 # \-\-\- Example file \-\-\-
544 # this is a comment
545 url = "example.com"
546 output = "curlhere.html"
547 user-agent = "superagent/1.0"
548.fi
549
550.nf
551 # and fetch another URL too
552 url = "example.com/docs/manpage.html"
553 \-O
554 referer = "http://nowhereatall.example.com/"
555 # \-\-\- End of example file \-\-\-
556.fi
557
558When curl is invoked, it (unless \-\-disable is used) checks for a default
559config file and uses it if found, even when \-\-config is used. The default
560config file is checked for in the following places in this order:
561
5621) "$CURL_HOME/.curlrc"
563
5642) "$XDG_CONFIG_HOME/.curlrc" (Added in 7.73.0)
565
5663) "$HOME/.curlrc"
567
5684) Windows: "%USERPROFILE%\\.curlrc"
569
5705) Windows: "%APPDATA%\\.curlrc"
571
5726) Windows: "%USERPROFILE%\\Application Data\\.curlrc"
573
5747) Non-Windows: use getpwuid to find the home directory
575
5768) On Windows, if it finds no .curlrc file in the sequence described above, it
577checks for one in the same dir the curl executable is placed.
578
579On Windows two filenames are checked per location: .curlrc and _curlrc,
580preferring the former. Older versions on Windows checked for _curlrc only.
581
582--config can be used several times in a command line
583
584Example:
585.nf
586 curl --config file.txt https://example.com
587.fi
588
589See also \fI-q, --disable\fP.
590.IP "\-\-connect-timeout <fractional seconds>"
591Maximum time in seconds that you allow curl's connection to take. This only
592limits the connection phase, so if curl connects within the given period it
593will continue \- if not it will exit. Since version 7.32.0, this option
594accepts decimal values.
595
596If --connect-timeout is provided several times, the last set value will be used.
597
598Examples:
599.nf
600 curl --connect-timeout 20 https://example.com
601 curl --connect-timeout 3.14 https://example.com
602.fi
603
604See also \fI-m, --max-time\fP.
605.IP "\-\-connect-to <HOST1:PORT1:HOST2:PORT2>"
606
607For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead.
608This option is suitable to direct requests at a specific server, e.g. at a
609specific cluster node in a cluster of servers. This option is only used to
610establish the network connection. It does NOT affect the hostname/port that is
611used for TLS/SSL (e.g. SNI, certificate verification) or for the application
612protocols. "HOST1" and "PORT1" may be the empty string, meaning "any
613host/port". "HOST2" and "PORT2" may also be the empty string, meaning "use the
614request's original host/port".
615
616A "host" specified to this option is compared as a string, so it needs to
617match the name used in request URL. It can be either numerical such as
618\(dq127.0.0.1" or the full host name such as "example.org".
619
620--connect-to can be used several times in a command line
621
622Example:
623.nf
624 curl --connect-to example.com:443:example.net:8443 https://example.com
625.fi
626
627See also \fI--resolve\fP and \fI-H, --header\fP. Added in 7.49.0.
628.IP "\-C, \-\-continue-at <offset>"
629Continue/Resume a previous file transfer at the given offset. The given offset
630is the exact number of bytes that will be skipped, counting from the beginning
631of the source file before it is transferred to the destination. If used with
632uploads, the FTP server command SIZE will not be used by curl.
633
634Use "-C \-" to tell curl to automatically find out where/how to resume the
635transfer. It then uses the given output/input files to figure that out.
636
637If --continue-at is provided several times, the last set value will be used.
638
639Examples:
640.nf
641 curl -C - https://example.com
642 curl -C 400 https://example.com
643.fi
644
645See also \fI-r, --range\fP.
646.IP "\-c, \-\-cookie-jar <filename>"
647(HTTP) Specify to which file you want curl to write all cookies after a completed
648operation. Curl writes all cookies from its in-memory cookie storage to the
649given file at the end of operations. If no cookies are known, no data will be
650written. The file will be written using the Netscape cookie file format. If
651you set the file name to a single dash, "-", the cookies will be written to
652stdout.
653
654This command line option will activate the cookie engine that makes curl
655record and use cookies. Another way to activate it is to use the \-\-cookie
656option.
657
658If the cookie jar cannot be created or written to, the whole curl operation
659will not fail or even report an error clearly. Using \-\-verbose will get a
660warning displayed, but that is the only visible feedback you get about this
661possibly lethal situation.
662
663If --cookie-jar is provided several times, the last set value will be used.
664
665Examples:
666.nf
667 curl -c store-here.txt https://example.com
668 curl -c store-here.txt -b read-these https://example.com
669.fi
670
671See also \fI-b, --cookie\fP.
672.IP "\-b, \-\-cookie <data|filename>"
673(HTTP) Pass the data to the HTTP server in the Cookie header. It is supposedly the
674data previously received from the server in a "Set-Cookie:" line. The data
675should be in the format "NAME1=VALUE1; NAME2=VALUE2". This makes curl use the
676cookie header with this content explicitly in all outgoing request(s). If
677multiple requests are done due to authentication, followed redirects or
678similar, they will all get this cookie passed on.
679
680If no '=' symbol is used in the argument, it is instead treated as a filename
681to read previously stored cookie from. This option also activates the cookie
682engine which will make curl record incoming cookies, which may be handy if
683you are using this in combination with the \-\-location option or do multiple URL
684transfers on the same invoke. If the file name is exactly a minus ("-"), curl
685will instead read the contents from stdin.
686
687The file format of the file to read cookies from should be plain HTTP headers
688(Set-Cookie style) or the Netscape/Mozilla cookie file format.
689
690The file specified with \-\-cookie is only used as input. No cookies will be
691written to the file. To store cookies, use the \-\-cookie-jar option.
692
693If you use the Set-Cookie file format and do not specify a domain then the
694cookie is not sent since the domain will never match. To address this, set a
695domain in Set-Cookie line (doing that will include sub-domains) or preferably:
696use the Netscape format.
697
698Users often want to both read cookies from a file and write updated cookies
699back to a file, so using both \-\-cookie and \-\-cookie-jar in the same command
700line is common.
701
702--cookie can be used several times in a command line
703
704Examples:
705.nf
706 curl -b cookiefile https://example.com
707 curl -b cookiefile -c cookiefile https://example.com
708.fi
709
710See also \fI-c, --cookie-jar\fP and \fI-j, --junk-session-cookies\fP.
711.IP "\-\-create-dirs"
712When used in conjunction with the \-\-output option, curl will create the
713necessary local directory hierarchy as needed. This option creates the
714directories mentioned with the \-\-output option, nothing else. If the \-\-output
715file name uses no directory, or if the directories it mentions already exist,
716no directories will be created.
717
718Created dirs are made with mode 0750 on unix style file systems.
719
720To create remote directories when using FTP or SFTP, try \fI\-\-ftp-create-dirs\fP.
721
722Providing --create-dirs multiple times has no extra effect.
723Disable it again with --no-create-dirs.
724
725Example:
726.nf
727 curl --create-dirs --output local/dir/file https://example.com
728.fi
729
730See also \fI--ftp-create-dirs\fP and \fI--output-dir\fP.
731.IP "\-\-create-file-mode <mode>"
732(SFTP SCP FILE) When curl is used to create files remotely using one of the supported
733protocols, this option allows the user to set which 'mode' to set on the file
734at creation time, instead of the default 0644.
735
736This option takes an octal number as argument.
737
738If --create-file-mode is provided several times, the last set value will be used.
739
740Example:
741.nf
742 curl --create-file-mode 0777 -T localfile sftp://example.com/new
743.fi
744
745See also \fI--ftp-create-dirs\fP. Added in 7.75.0.
746.IP "\-\-crlf"
747(FTP SMTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
748
749(SMTP added in 7.40.0)
750
751Providing --crlf multiple times has no extra effect.
752Disable it again with --no-crlf.
753
754Example:
755.nf
756 curl --crlf -T file ftp://example.com/
757.fi
758
759See also \fI-B, --use-ascii\fP.
760.IP "\-\-crlfile <file>"
761(TLS) Provide a file using PEM format with a Certificate Revocation List that may
762specify peer certificates that are to be considered revoked.
763
764If --crlfile is provided several times, the last set value will be used.
765
766Example:
767.nf
768 curl --crlfile rejects.txt https://example.com
769.fi
770
771See also \fI--cacert\fP and \fI--capath\fP.
772.IP "\-\-curves <algorithm list>"
773(TLS) Tells curl to request specific curves to use during SSL session establishment
774according to RFC 8422, 5.1. Multiple algorithms can be provided by separating
775them with ":" (e.g. "X25519:P-521"). The parameter is available identically
776in the "openssl s_client/s_server" utilities.
777
778\-\-curves allows a OpenSSL powered curl to make SSL-connections with exactly
779the (EC) curve requested by the client, avoiding nontransparent client/server
780negotiations.
781
782If this option is set, the default curves list built into openssl will be
783ignored.
784
785If --curves is provided several times, the last set value will be used.
786
787Example:
788.nf
789 curl --curves X25519 https://example.com
790.fi
791
792See also \fI--ciphers\fP. Added in 7.73.0.
793.IP "\-\-data-ascii <data>"
794(HTTP) This is just an alias for \fI\-d, \-\-data\fP.
795
796--data-ascii can be used several times in a command line
797
798Example:
799.nf
800 curl --data-ascii @file https://example.com
801.fi
802
803See also \fI--data-binary\fP, \fI--data-raw\fP and \fI--data-urlencode\fP.
804.IP "\-\-data-binary <data>"
805(HTTP) This posts data exactly as specified with no extra processing whatsoever.
806
807If you start the data with the letter @, the rest should be a filename. Data
808is posted in a similar manner as \-\-data does, except that newlines and
809carriage returns are preserved and conversions are never done.
810
811Like \-\-data the default content-type sent to the server is
812application/x-www-form-urlencoded. If you want the data to be treated as
813arbitrary binary data by the server then set the content-type to octet-stream:
814\-H "Content-Type: application/octet-stream".
815
816If this option is used several times, the ones following the first will append
817data as described in \fI\-d, \-\-data\fP.
818
819--data-binary can be used several times in a command line
820
821Example:
822.nf
823 curl --data-binary @filename https://example.com
824.fi
825
826See also \fI--data-ascii\fP.
827.IP "\-\-data-raw <data>"
828(HTTP) This posts data similarly to \-\-data but without the special
829interpretation of the @ character.
830
831--data-raw can be used several times in a command line
832
833Examples:
834.nf
835 curl --data-raw "hello" https://example.com
836 curl --data-raw "@at@at@" https://example.com
837.fi
838
839See also \fI-d, --data\fP. Added in 7.43.0.
840.IP "\-\-data-urlencode <data>"
841(HTTP) This posts data, similar to the other \-\-data options with the exception
842that this performs URL-encoding.
843
844To be CGI-compliant, the <data> part should begin with a \fIname\fP followed
845by a separator and a content specification. The <data> part can be passed to
846curl using one of the following syntaxes:
847.RS
848.IP "content"
849This will make curl URL-encode the content and pass that on. Just be careful
850so that the content does not contain any = or @ symbols, as that will then make
851the syntax match one of the other cases below!
852.IP "=content"
853This will make curl URL-encode the content and pass that on. The preceding =
854symbol is not included in the data.
855.IP "name=content"
856This will make curl URL-encode the content part and pass that on. Note that
857the name part is expected to be URL-encoded already.
858.IP "@filename"
859This will make curl load data from the given file (including any newlines),
860URL-encode that data and pass it on in the POST.
861.IP "name@filename"
862This will make curl load data from the given file (including any newlines),
863URL-encode that data and pass it on in the POST. The name part gets an equal
864sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
865name is expected to be URL-encoded already.
866.RE
867
868--data-urlencode can be used several times in a command line
869
870Examples:
871.nf
872 curl --data-urlencode name=val https://example.com
873 curl --data-urlencode =encodethis https://example.com
874 curl --data-urlencode name@file https://example.com
875 curl --data-urlencode @fileonly https://example.com
876.fi
877
878See also \fI-d, --data\fP and \fI--data-raw\fP.
879.IP "\-d, \-\-data <data>"
880(HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way
881that a browser does when a user has filled in an HTML form and presses the
882submit button. This will cause curl to pass the data to the server using the
883content-type application/x-www-form-urlencoded. Compare to \fI\-F, \-\-form\fP.
884
885\-\-data-raw is almost the same but does not have a special interpretation of
886the @ character. To post data purely binary, you should instead use the
887\-\-data-binary option. To URL-encode the value of a form field you may use
888\fI\-\-data-urlencode\fP.
889
890If any of these options is used more than once on the same command line, the
891data pieces specified will be merged with a separating &-symbol. Thus, using
892\(aq-d name=daniel \-d skill=lousy' would generate a post chunk that looks like
893\(aqname=daniel&skill=lousy'.
894
895If you start the data with the letter @, the rest should be a file name to
896read the data from, or \- if you want curl to read the data from stdin. Posting
897data from a file named 'foobar' would thus be done with \fI\-d, \-\-data\fP @foobar. When
898\-\-data is told to read from a file like that, carriage returns and newlines
899will be stripped out. If you do not want the @ character to have a special
900interpretation use \-\-data-raw instead.
901
902--data can be used several times in a command line
903
904Examples:
905.nf
906 curl -d "name=curl" https://example.com
907 curl -d "name=curl" -d "tool=cmdline" https://example.com
908 curl -d @filename https://example.com
909.fi
910
911See also \fI--data-binary\fP, \fI--data-urlencode\fP and \fI--data-raw\fP. This option is mutually exclusive to \fI-F, --form\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP.
912.IP "\-\-delegation <LEVEL>"
913(GSS/kerberos) Set LEVEL to tell the server what it is allowed to delegate when it
914comes to user credentials.
915.RS
916.IP "none"
917Do not allow any delegation.
918.IP "policy"
919Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos
920service ticket, which is a matter of realm policy.
921.IP "always"
922Unconditionally allow the server to delegate.
923.RE
924
925If --delegation is provided several times, the last set value will be used.
926
927Example:
928.nf
929 curl --delegation "none" https://example.com
930.fi
931
932See also \fI-k, --insecure\fP and \fI--ssl\fP.
933.IP "\-\-digest"
934(HTTP) Enables HTTP Digest authentication. This is an authentication scheme that
935prevents the password from being sent over the wire in clear text. Use this in
936combination with the normal \-\-user option to set user name and password.
937
938Providing --digest multiple times has no extra effect.
939Disable it again with --no-digest.
940
941Example:
942.nf
943 curl -u name:password --digest https://example.com
944.fi
945
946See also \fI-u, --user\fP, \fI--proxy-digest\fP and \fI--anyauth\fP. This option is mutually exclusive to \fI--basic\fP and \fI--ntlm\fP and \fI--negotiate\fP.
947.IP "\-\-disable-eprt"
948(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active
949FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT
950before using PORT, but with this option, it will use PORT right away. EPRT and
951LPRT are extensions to the original FTP protocol, and may not work on all
952servers, but they enable more functionality in a better way than the
953traditional PORT command.
954
955\-\-eprt can be used to explicitly enable EPRT again and \-\-no-eprt is an alias
956for \fI\-\-disable-eprt\fP.
957
958If the server is accessed using IPv6, this option will have no effect as EPRT
959is necessary then.
960
961Disabling EPRT only changes the active behavior. If you want to switch to
962passive mode you need to not use \-\-ftp-port or force it with \fI\-\-ftp-pasv\fP.
963
964Providing --disable-eprt multiple times has no extra effect.
965Disable it again with --no-disable-eprt.
966
967Example:
968.nf
969 curl --disable-eprt ftp://example.com/
970.fi
971
972See also \fI--disable-epsv\fP and \fI-P, --ftp-port\fP.
973.IP "\-\-disable-epsv"
974(FTP) Tell curl to disable the use of the EPSV command when doing passive FTP
975transfers. Curl will normally always first attempt to use EPSV before
976PASV, but with this option, it will not try using EPSV.
977
978\-\-epsv can be used to explicitly enable EPSV again and \-\-no-epsv is an alias
979for \fI\-\-disable-epsv\fP.
980
981If the server is an IPv6 host, this option will have no effect as EPSV is
982necessary then.
983
984Disabling EPSV only changes the passive behavior. If you want to switch to
985active mode you need to use \fI\-P, \-\-ftp-port\fP.
986
987Providing --disable-epsv multiple times has no extra effect.
988Disable it again with --no-disable-epsv.
989
990Example:
991.nf
992 curl --disable-epsv ftp://example.com/
993.fi
994
995See also \fI--disable-eprt\fP and \fI-P, --ftp-port\fP.
996.IP "\-q, \-\-disable"
997If used as the first parameter on the command line, the \fIcurlrc\fP config
998file will not be read and used. See the \-\-config for details on the default
999config file search path.
1000
1001Providing --disable multiple times has no extra effect.
1002Disable it again with --no-disable.
1003
1004Example:
1005.nf
1006 curl -q https://example.com
1007.fi
1008
1009See also \fI-K, --config\fP.
1010.IP "\-\-disallow-username-in-url"
1011(HTTP) This tells curl to exit if passed a URL containing a username. This is probably
1012most useful when the URL is being provided at runtime or similar.
1013
1014Providing --disallow-username-in-url multiple times has no extra effect.
1015Disable it again with --no-disallow-username-in-url.
1016
1017Example:
1018.nf
1019 curl --disallow-username-in-url https://example.com
1020.fi
1021
1022See also \fI--proto\fP. Added in 7.61.0.
1023.IP "\-\-dns-interface <interface>"
1024(DNS) Tell curl to send outgoing DNS requests through <interface>. This option is a
1025counterpart to \fI\-\-interface\fP (which does not affect DNS). The supplied string
1026must be an interface name (not an address).
1027
1028If --dns-interface is provided several times, the last set value will be used.
1029
1030Example:
1031.nf
1032 curl --dns-interface eth0 https://example.com
1033.fi
1034
1035See 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.
1036.IP "\-\-dns-ipv4-addr <address>"
1037(DNS) Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that
1038the DNS requests originate from this address. The argument should be a
1039single IPv4 address.
1040
1041If --dns-ipv4-addr is provided several times, the last set value will be used.
1042
1043Example:
1044.nf
1045 curl --dns-ipv4-addr 10.1.2.3 https://example.com
1046.fi
1047
1048See 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.
1049.IP "\-\-dns-ipv6-addr <address>"
1050(DNS) Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that
1051the DNS requests originate from this address. The argument should be a
1052single IPv6 address.
1053
1054If --dns-ipv6-addr is provided several times, the last set value will be used.
1055
1056Example:
1057.nf
1058 curl --dns-ipv6-addr 2a04:4e42::561 https://example.com
1059.fi
1060
1061See 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.
1062.IP "\-\-dns-servers <addresses>"
1063Set the list of DNS servers to be used instead of the system default.
1064The list of IP addresses should be separated with commas. Port numbers
1065may also optionally be given as \fI:<port-number>\fP after each IP
1066address.
1067
1068If --dns-servers is provided several times, the last set value will be used.
1069
1070Example:
1071.nf
1072 curl --dns-servers 192.168.0.1,192.168.0.2 https://example.com
1073.fi
1074
1075See also \fI--dns-interface\fP and \fI--dns-ipv4-addr\fP. \fI--dns-servers\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
1076.IP "\-\-doh-cert-status"
1077Same as \-\-cert-status but used for DoH (DNS-over-HTTPS).
1078
1079Providing --doh-cert-status multiple times has no extra effect.
1080Disable it again with --no-doh-cert-status.
1081
1082Example:
1083.nf
1084 curl --doh-cert-status --doh-url https://doh.example https://example.com
1085.fi
1086
1087See also \fI--doh-insecure\fP. Added in 7.76.0.
1088.IP "\-\-doh-insecure"
1089Same as \-\-insecure but used for DoH (DNS-over-HTTPS).
1090
1091Providing --doh-insecure multiple times has no extra effect.
1092Disable it again with --no-doh-insecure.
1093
1094Example:
1095.nf
1096 curl --doh-insecure --doh-url https://doh.example https://example.com
1097.fi
1098
1099See also \fI--doh-url\fP. Added in 7.76.0.
1100.IP "\-\-doh-url <URL>"
1101Specifies which DNS-over-HTTPS (DoH) server to use to resolve hostnames,
1102instead of using the default name resolver mechanism. The URL must be HTTPS.
1103
1104Some SSL options that you set for your transfer will apply to DoH since the
1105name lookups take place over SSL. However, the certificate verification
1106settings are not inherited and can be controlled separately via
1107\-\-doh-insecure and \fI\-\-doh-cert-status\fP.
1108
1109This option is unset if an empty string "" is used as the URL. (Added in
11107.85.0)
1111
1112If --doh-url is provided several times, the last set value will be used.
1113
1114Example:
1115.nf
1116 curl --doh-url https://doh.example https://example.com
1117.fi
1118
1119See also \fI--doh-insecure\fP. Added in 7.62.0.
1120.IP "\-D, \-\-dump-header <filename>"
1121(HTTP FTP) Write the received protocol headers to the specified file. If no headers are
1122received, the use of this option will create an empty file.
1123
1124When used in FTP, the FTP server response lines are considered being "headers"
1125and thus are saved there.
1126
1127If --dump-header is provided several times, the last set value will be used.
1128
1129Example:
1130.nf
1131 curl --dump-header store.txt https://example.com
1132.fi
1133
1134See also \fI-o, --output\fP.
1135.IP "\-\-egd-file <file>"
1136(TLS) Deprecated option. This option is ignored by curl since 7.84.0. Prior to that
1137it only had an effect on curl if built to use old versions of OpenSSL.
1138
1139Specify the path name to the Entropy Gathering Daemon socket. The socket is
1140used to seed the random engine for SSL connections.
1141
1142If --egd-file is provided several times, the last set value will be used.
1143
1144Example:
1145.nf
1146 curl --egd-file /random/here https://example.com
1147.fi
1148
1149See also \fI--random-file\fP.
1150.IP "\-\-engine <name>"
1151(TLS) Select the OpenSSL crypto engine to use for cipher operations. Use \-\-engine
1152list to print a list of build-time supported engines. Note that not all (and
1153possibly none) of the engines may be available at runtime.
1154
1155If --engine is provided several times, the last set value will be used.
1156
1157Example:
1158.nf
1159 curl --engine flavor https://example.com
1160.fi
1161
1162See also \fI--ciphers\fP and \fI--curves\fP.
1163.IP "\-\-etag-compare <file>"
1164(HTTP) This option makes a conditional HTTP request for the specific ETag read
1165from the given file by sending a custom If-None-Match header using the
1166stored ETag.
1167
1168For correct results, make sure that the specified file contains only a
1169single line with the desired ETag. An empty file is parsed as an empty
1170ETag.
1171
1172Use the option \-\-etag-save to first save the ETag from a response, and
1173then use this option to compare against the saved ETag in a subsequent
1174request.
1175
1176If --etag-compare is provided several times, the last set value will be used.
1177
1178Example:
1179.nf
1180 curl --etag-compare etag.txt https://example.com
1181.fi
1182
1183See also \fI--etag-save\fP and \fI-z, --time-cond\fP. Added in 7.68.0.
1184.IP "\-\-etag-save <file>"
1185(HTTP) This option saves an HTTP ETag to the specified file. An ETag is a
1186caching related header, usually returned in a response.
1187
1188If no ETag is sent by the server, an empty file is created.
1189
1190If --etag-save is provided several times, the last set value will be used.
1191
1192Example:
1193.nf
1194 curl --etag-save storetag.txt https://example.com
1195.fi
1196
1197See also \fI--etag-compare\fP. Added in 7.68.0.
1198.IP "\-\-expect100-timeout <seconds>"
1199(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
1200response when curl emits an Expects: 100-continue header in its request. By
1201default curl will wait one second. This option accepts decimal values! When
1202curl stops waiting, it will continue as if the response has been received.
1203
1204If --expect100-timeout is provided several times, the last set value will be used.
1205
1206Example:
1207.nf
1208 curl --expect100-timeout 2.5 -T file https://example.com
1209.fi
1210
1211See also \fI--connect-timeout\fP. Added in 7.47.0.
1212.IP "\-\-fail-early"
1213Fail and exit on the first detected transfer error.
1214
1215When curl is used to do multiple transfers on the command line, it will
1216attempt to operate on each given URL, one by one. By default, it will ignore
1217errors if there are more URLs given and the last URL's success will determine
1218the error code curl returns. So early failures will be "hidden" by subsequent
1219successful transfers.
1220
1221Using this option, curl will instead return an error on the first transfer
1222that fails, independent of the amount of URLs that are given on the command
1223line. This way, no transfer failures go undetected by scripts and similar.
1224
1225This option is global and does not need to be specified for each use of \fI\-:, \-\-next\fP.
1226
1227This option does not imply \fI\-f, \-\-fail\fP, which causes transfers to fail due to the
1228server's HTTP status code. You can combine the two options, however note \-\-fail
1229is not global and is therefore contained by \fI\-:, \-\-next\fP.
1230
1231Providing --fail-early multiple times has no extra effect.
1232Disable it again with --no-fail-early.
1233
1234Example:
1235.nf
1236 curl --fail-early https://example.com https://two.example
1237.fi
1238
1239See also \fI-f, --fail\fP and \fI--fail-with-body\fP. Added in 7.52.0.
1240.IP "\-\-fail-with-body"
1241(HTTP) Return an error on server errors where the HTTP response code is 400 or
1242greater). In normal cases when an HTTP server fails to deliver a document, it
1243returns an HTML document stating so (which often also describes why and
1244more). This flag will still allow curl to output and save that content but
1245also to return error 22.
1246
1247This is an alternative option to \-\-fail which makes curl fail for the same
1248circumstances but without saving the content.
1249
1250Providing --fail-with-body multiple times has no extra effect.
1251Disable it again with --no-fail-with-body.
1252
1253Example:
1254.nf
1255 curl --fail-with-body https://example.com
1256.fi
1257
1258See also \fI-f, --fail\fP. This option is mutually exclusive to \fI-f, --fail\fP. Added in 7.76.0.
1259.IP "\-f, \-\-fail"
1260(HTTP) Fail fast with no output at all on server errors. This is useful to enable
1261scripts and users to better deal with failed attempts. In normal cases when an
1262HTTP server fails to deliver a document, it returns an HTML document stating
1263so (which often also describes why and more). This flag will prevent curl from
1264outputting that and return error 22.
1265
1266This method is not fail-safe and there are occasions where non-successful
1267response codes will slip through, especially when authentication is involved
1268(response codes 401 and 407).
1269
1270Providing --fail multiple times has no extra effect.
1271Disable it again with --no-fail.
1272
1273Example:
1274.nf
1275 curl --fail https://example.com
1276.fi
1277
1278See also \fI--fail-with-body\fP. This option is mutually exclusive to \fI--fail-with-body\fP.
1279.IP "\-\-false-start"
1280(TLS) Tells curl to use false start during the TLS handshake. False start is a mode
1281where a TLS client will start sending application data before verifying the
1282server's Finished message, thus saving a round trip when performing a full
1283handshake.
1284
1285This is currently only implemented in the NSS and Secure Transport (on iOS 7.0
1286or later, or OS X 10.9 or later) backends.
1287
1288Providing --false-start multiple times has no extra effect.
1289Disable it again with --no-false-start.
1290
1291Example:
1292.nf
1293 curl --false-start https://example.com
1294.fi
1295
1296See also \fI--tcp-fastopen\fP. Added in 7.42.0.
1297.IP "\-\-form-escape"
1298(HTTP) Tells curl to pass on names of multipart form fields and files using
1299backslash-escaping instead of percent-encoding.
1300
1301If --form-escape is provided several times, the last set value will be used.
1302
1303Example:
1304.nf
1305 curl --form-escape -F 'field\\name=curl' -F 'file=@load"this' https://example.com
1306.fi
1307
1308See also \fI-F, --form\fP. Added in 7.81.0.
1309.IP "\-\-form-string <name=string>"
1310(HTTP SMTP IMAP) Similar to \-\-form except that the value string for the named parameter is used
1311literally. Leading '@' and '<' characters, and the ';type=' string in
1312the value have no special meaning. Use this in preference to \-\-form if
1313there's any possibility that the string value may accidentally trigger the
1314\(aq@' or '<' features of \fI\-F, \-\-form\fP.
1315
1316--form-string can be used several times in a command line
1317
1318Example:
1319.nf
1320 curl --form-string "data" https://example.com
1321.fi
1322
1323See also \fI-F, --form\fP.
1324.IP "\-F, \-\-form <name=content>"
1325(HTTP SMTP IMAP) For HTTP protocol family, this lets curl emulate a filled-in form in which a
1326user has pressed the submit button. This causes curl to POST data using the
1327Content-Type multipart/form-data according to RFC 2388.
1328
1329For SMTP and IMAP protocols, this is the means to compose a multipart mail
1330message to transmit.
1331
1332This enables uploading of binary files etc. To force the 'content' part to be
1333a file, prefix the file name with an @ sign. To just get the content part from
1334a file, prefix the file name with the symbol <. The difference between @ and <
1335is then that @ makes a file get attached in the post as a file upload, while
1336the < makes a text field and just get the contents for that text field from a
1337file.
1338
1339Tell curl to read content from stdin instead of a file by using \- as
1340filename. This goes for both @ and < constructs. When stdin is used, the
1341contents is buffered in memory first by curl to determine its size and allow a
1342possible resend. Defining a part's data from a named non-regular file (such
1343as a named pipe or similar) is unfortunately not subject to buffering and will
1344be effectively read at transmission time; since the full size is unknown
1345before the transfer starts, such data is sent as chunks by HTTP and rejected
1346by IMAP.
1347
1348Example: send an image to an HTTP server, where 'profile' is the name of the
1349form-field to which the file portrait.jpg will be the input:
1350
1351.nf
1352 curl \-F profile=@portrait.jpg https://example.com/upload.cgi
1353.fi
1354
1355Example: send your name and shoe size in two text fields to the server:
1356
1357.nf
1358 curl \-F name=John \-F shoesize=11 https://example.com/
1359.fi
1360
1361Example: send your essay in a text field to the server. Send it as a plain
1362text field, but get the contents for it from a local file:
1363
1364.nf
1365 curl \-F "story=<hugefile.txt" https://example.com/
1366.fi
1367
1368You can also tell curl what Content-Type to use by using 'type=', in a manner
1369similar to:
1370
1371.nf
1372 curl \-F "web=@index.html;type=text/html" example.com
1373.fi
1374
1375or
1376
1377.nf
1378 curl \-F "name=daniel;type=text/foo" example.com
1379.fi
1380
1381You can also explicitly change the name field of a file upload part by setting
1382filename=, like this:
1383
1384.nf
1385 curl \-F "file=@localfile;filename=nameinpost" example.com
1386.fi
1387
1388If filename/path contains ',' or ';', it must be quoted by double-quotes like:
1389
1390.nf
1391 curl \-F "file=@\\"local,file\\";filename=\\"name;in;post\\"" example.com
1392.fi
1393
1394or
1395
1396.nf
1397 curl \-F 'file=@"local,file";filename="name;in;post"' example.com
1398.fi
1399
1400Note that if a filename/path is quoted by double-quotes, any double-quote
1401or backslash within the filename must be escaped by backslash.
1402
1403Quoting must also be applied to non-file data if it contains semicolons,
1404leading/trailing spaces or leading double quotes:
1405
1406.nf
1407 curl \-F 'colors="red; green; blue";type=text/x-myapp' example.com
1408.fi
1409
1410You can add custom headers to the field by setting headers=, like
1411
1412.nf
1413 curl \-F "submit=OK;headers=\\"X-submit-type: OK\\"" example.com
1414.fi
1415
1416or
1417
1418.nf
1419 curl \-F "submit=OK;headers=@headerfile" example.com
1420.fi
1421
1422The headers= keyword may appear more that once and above notes about quoting
1423apply. When headers are read from a file, Empty lines and lines starting
1424with '#' are comments and ignored; each header can be folded by splitting
1425between two words and starting the continuation line with a space; embedded
1426carriage-returns and trailing spaces are stripped.
1427Here is an example of a header file contents:
1428
1429.nf
1430 # This file contain two headers.
1431 X-header-1: this is a header
1432.fi
1433
1434.nf
1435 # The following header is folded.
1436 X-header-2: this is
1437 another header
1438.fi
1439
1440To support sending multipart mail messages, the syntax is extended as follows:
1441.br
1442\- name can be omitted: the equal sign is the first character of the argument,
1443.br
1444\- if data starts with '(', this signals to start a new multipart: it can be
1445followed by a content type specification.
1446.br
1447\- a multipart can be terminated with a '=)' argument.
1448
1449Example: the following command sends an SMTP mime email consisting in an
1450inline part in two alternative formats: plain text and HTML. It attaches a
1451text file:
1452
1453.nf
1454 curl \-F '=(;type=multipart/alternative' \\
1455 \-F '=plain text message' \\
1456 \-F '= <body>HTML message</body>;type=text/html' \\
1457 \-F '=)' \-F '=@textfile.txt' ... smtp://example.com
1458.fi
1459
1460Data can be encoded for transfer using encoder=. Available encodings are
1461\fIbinary\fP and \fI8bit\fP that do nothing else than adding the corresponding
1462Content-Transfer-Encoding header, \fI7bit\fP that only rejects 8-bit characters
1463with a transfer error, \fIquoted-printable\fP and \fIbase64\fP that encodes data
1464according to the corresponding schemes, limiting lines length to 76
1465characters.
1466
1467Example: send multipart mail with a quoted-printable text message and a
1468base64 attached file:
1469
1470.nf
1471 curl \-F '=text message;encoder=quoted-printable' \\
1472 \-F '=@localfile;encoder=base64' ... smtp://example.com
1473.fi
1474
1475See further examples and details in the MANUAL.
1476
1477--form can be used several times in a command line
1478
1479Example:
1480.nf
1481 curl --form "name=curl" --form "file=@loadthis" https://example.com
1482.fi
1483
1484See also \fI-d, --data\fP, \fI--form-string\fP and \fI--form-escape\fP. This option is mutually exclusive to \fI-d, --data\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP.
1485.IP "\-\-ftp-account <data>"
1486(FTP) When an FTP server asks for "account data" after user name and password has
1487been provided, this data is sent off using the ACCT command.
1488
1489If --ftp-account is provided several times, the last set value will be used.
1490
1491Example:
1492.nf
1493 curl --ftp-account "mr.robot" ftp://example.com/
1494.fi
1495
1496See also \fI-u, --user\fP.
1497.IP "\-\-ftp-alternative-to-user <command>"
1498(FTP) If authenticating with the USER and PASS commands fails, send this command.
1499When connecting to Tumbleweed's Secure Transport server over FTPS using a
1500client certificate, using "SITE AUTH" will tell the server to retrieve the
1501username from the certificate.
1502
1503If --ftp-alternative-to-user is provided several times, the last set value will be used.
1504
1505Example:
1506.nf
1507 curl --ftp-alternative-to-user "U53r" ftp://example.com
1508.fi
1509
1510See also \fI--ftp-account\fP and \fI-u, --user\fP.
1511.IP "\-\-ftp-create-dirs"
1512(FTP SFTP) When an FTP or SFTP URL/operation uses a path that does not currently exist on
1513the server, the standard behavior of curl is to fail. Using this option, curl
1514will instead attempt to create missing directories.
1515
1516Providing --ftp-create-dirs multiple times has no extra effect.
1517Disable it again with --no-ftp-create-dirs.
1518
1519Example:
1520.nf
1521 curl --ftp-create-dirs -T file ftp://example.com/remote/path/file
1522.fi
1523
1524See also \fI--create-dirs\fP.
1525.IP "\-\-ftp-method <method>"
1526(FTP) Control what method curl should use to reach a file on an FTP(S)
1527server. The method argument should be one of the following alternatives:
1528.RS
1529.IP multicwd
1530curl does a single CWD operation for each path part in the given URL. For deep
1531hierarchies this means many commands. This is how RFC 1738 says it should
1532be done. This is the default but the slowest behavior.
1533.IP nocwd
1534curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full
1535path to the server for all these commands. This is the fastest behavior.
1536.IP singlecwd
1537curl does one CWD with the full target directory and then operates on the file
1538\(dqnormally" (like in the multicwd case). This is somewhat more standards
1539compliant than 'nocwd' but without the full penalty of 'multicwd'.
1540.RE
1541
1542If --ftp-method is provided several times, the last set value will be used.
1543
1544Examples:
1545.nf
1546 curl --ftp-method multicwd ftp://example.com/dir1/dir2/file
1547 curl --ftp-method nocwd ftp://example.com/dir1/dir2/file
1548 curl --ftp-method singlecwd ftp://example.com/dir1/dir2/file
1549.fi
1550
1551See also \fI-l, --list-only\fP.
1552.IP "\-\-ftp-pasv"
1553(FTP) Use passive mode for the data connection. Passive is the internal default
1554behavior, but using this option can be used to override a previous \-\-ftp-port
1555option.
1556
1557Reversing an enforced passive really is not doable but you must then instead
1558enforce the correct \-\-ftp-port again.
1559
1560Passive mode means that curl will try the EPSV command first and then PASV,
1561unless \-\-disable-epsv is used.
1562
1563Providing --ftp-pasv multiple times has no extra effect.
1564Disable it again with --no-ftp-pasv.
1565
1566Example:
1567.nf
1568 curl --ftp-pasv ftp://example.com/
1569.fi
1570
1571See also \fI--disable-epsv\fP.
1572.IP "\-P, \-\-ftp-port <address>"
1573(FTP) Reverses the default initiator/listener roles when connecting with FTP. This
1574option makes curl use active mode. curl then tells the server to connect back
1575to the client's specified address and port, while passive mode asks the server
1576to setup an IP address and port for it to connect to. <address> should be one
1577of:
1578.RS
1579.IP interface
1580e.g. "eth0" to specify which interface's IP address you want to use (Unix only)
1581.IP "IP address"
1582e.g. "192.168.10.1" to specify the exact IP address
1583.IP "host name"
1584e.g. "my.host.domain" to specify the machine
1585.IP "-"
1586make curl pick the same IP address that is already used for the control
1587connection
1588.RE
1589
1590Disable the use of PORT with \fI\-\-ftp-pasv\fP. Disable the attempt to use the EPRT
1591command instead of PORT by using \fI\-\-disable-eprt\fP. EPRT is really PORT++.
1592
1593You can also append ":[start]-[end]\&" to the right of the address, to tell
1594curl what TCP port range to use. That means you specify a port range, from a
1595lower to a higher number. A single number works as well, but do note that it
1596increases the risk of failure since the port may not be available.
1597
1598
1599If --ftp-port is provided several times, the last set value will be used.
1600
1601Examples:
1602.nf
1603 curl -P - ftp:/example.com
1604 curl -P eth0 ftp:/example.com
1605 curl -P 192.168.0.2 ftp:/example.com
1606.fi
1607
1608See also \fI--ftp-pasv\fP and \fI--disable-eprt\fP.
1609.IP "\-\-ftp-pret"
1610(FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers,
1611mainly drftpd, require this non-standard command for directory listings as
1612well as up and downloads in PASV mode.
1613
1614Providing --ftp-pret multiple times has no extra effect.
1615Disable it again with --no-ftp-pret.
1616
1617Example:
1618.nf
1619 curl --ftp-pret ftp://example.com/
1620.fi
1621
1622See also \fI-P, --ftp-port\fP and \fI--ftp-pasv\fP.
1623.IP "\-\-ftp-skip-pasv-ip"
1624(FTP) Tell curl to not use the IP address the server suggests in its response
1625to curl's PASV command when curl connects the data connection. Instead curl
1626will re-use the same IP address it already uses for the control
1627connection.
1628
1629Since curl 7.74.0 this option is enabled by default.
1630
1631This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
1632
1633Providing --ftp-skip-pasv-ip multiple times has no extra effect.
1634Disable it again with --no-ftp-skip-pasv-ip.
1635
1636Example:
1637.nf
1638 curl --ftp-skip-pasv-ip ftp://example.com/
1639.fi
1640
1641See also \fI--ftp-pasv\fP.
1642.IP "\-\-ftp-ssl-ccc-mode <active/passive>"
1643(FTP) Sets the CCC mode. The passive mode will not initiate the shutdown, but
1644instead wait for the server to do it, and will not reply to the shutdown from
1645the server. The active mode initiates the shutdown and waits for a reply from
1646the server.
1647
1648Providing --ftp-ssl-ccc-mode multiple times has no extra effect.
1649Disable it again with --no-ftp-ssl-ccc-mode.
1650
1651Example:
1652.nf
1653 curl --ftp-ssl-ccc-mode active --ftp-ssl-ccc ftps://example.com/
1654.fi
1655
1656See also \fI--ftp-ssl-ccc\fP.
1657.IP "\-\-ftp-ssl-ccc"
1658(FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after
1659authenticating. The rest of the control channel communication will be
1660unencrypted. This allows NAT routers to follow the FTP transaction. The
1661default mode is passive.
1662
1663Providing --ftp-ssl-ccc multiple times has no extra effect.
1664Disable it again with --no-ftp-ssl-ccc.
1665
1666Example:
1667.nf
1668 curl --ftp-ssl-ccc ftps://example.com/
1669.fi
1670
1671See also \fI--ssl\fP and \fI--ftp-ssl-ccc-mode\fP.
1672.IP "\-\-ftp-ssl-control"
1673(FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure
1674authentication, but non-encrypted data transfers for efficiency. Fails the
1675transfer if the server does not support SSL/TLS.
1676
1677Providing --ftp-ssl-control multiple times has no extra effect.
1678Disable it again with --no-ftp-ssl-control.
1679
1680Example:
1681.nf
1682 curl --ftp-ssl-control ftp://example.com
1683.fi
1684
1685See also \fI--ssl\fP.
1686.IP "\-G, \-\-get"
1687When used, this option will make all data specified with \fI\-d, \-\-data\fP, \-\-data-binary
1688or \-\-data-urlencode to be used in an HTTP GET request instead of the POST
1689request that otherwise would be used. The data will be appended to the URL
1690with a '?' separator.
1691
1692If used in combination with \fI\-I, \-\-head\fP, the POST data will instead be appended to
1693the URL with a HEAD request.
1694
1695Providing --get multiple times has no extra effect.
1696Disable it again with --no-get.
1697
1698Examples:
1699.nf
1700 curl --get https://example.com
1701 curl --get -d "tool=curl" -d "age=old" https://example.com
1702 curl --get -I -d "tool=curl" https://example.com
1703.fi
1704
1705See also \fI-d, --data\fP and \fI-X, --request\fP.
1706.IP "\-g, \-\-globoff"
1707This option switches off the "URL globbing parser". When you set this option,
1708you can specify URLs that contain the letters {}[] without having curl itself
1709interpret them. Note that these letters are not normal legal URL contents but
1710they should be encoded according to the URI standard.
1711
1712Providing --globoff multiple times has no extra effect.
1713Disable it again with --no-globoff.
1714
1715Example:
1716.nf
1717 curl -g "https://example.com/{[]}}}}"
1718.fi
1719
1720See also \fI-K, --config\fP and \fI-q, --disable\fP.
1721.IP "\-\-happy-eyeballs-timeout-ms <milliseconds>"
1722Happy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6
1723addresses for dual-stack hosts, giving IPv6 a head-start of the specified
1724number of milliseconds. If the IPv6 address cannot be connected to within that
1725time, then a connection attempt is made to the IPv4 address in parallel. The
1726first connection to be established is the one that is used.
1727
1728The range of suggested useful values is limited. Happy Eyeballs RFC 6555 says
1729\(dqIt is RECOMMENDED that connection attempts be paced 150-250 ms apart to
1730balance human factors against network load." libcurl currently defaults to
1731200 ms. Firefox and Chrome currently default to 300 ms.
1732
1733If --happy-eyeballs-timeout-ms is provided several times, the last set value will be used.
1734
1735Example:
1736.nf
1737 curl --happy-eyeballs-timeout-ms 500 https://example.com
1738.fi
1739
1740See also \fI-m, --max-time\fP and \fI--connect-timeout\fP. Added in 7.59.0.
1741.IP "\-\-haproxy-protocol"
1742(HTTP) Send a HAProxy PROXY protocol v1 header at the beginning of the
1743connection. This is used by some load balancers and reverse proxies to
1744indicate the client's true IP address and port.
1745
1746This option is primarily useful when sending test requests to a service that
1747expects this header.
1748
1749Providing --haproxy-protocol multiple times has no extra effect.
1750Disable it again with --no-haproxy-protocol.
1751
1752Example:
1753.nf
1754 curl --haproxy-protocol https://example.com
1755.fi
1756
1757See also \fI-x, --proxy\fP. Added in 7.60.0.
1758.IP "\-I, \-\-head"
1759(HTTP FTP FILE) Fetch the headers only! HTTP-servers feature the command HEAD which this uses
1760to get nothing but the header of a document. When used on an FTP or FILE file,
1761curl displays the file size and last modification time only.
1762
1763Providing --head multiple times has no extra effect.
1764Disable it again with --no-head.
1765
1766Example:
1767.nf
1768 curl -I https://example.com
1769.fi
1770
1771See also \fI-G, --get\fP, \fI-v, --verbose\fP and \fI--trace-ascii\fP.
1772.IP "\-H, \-\-header <header/@file>"
1773(HTTP IMAP SMTP) Extra header to include in information sent. When used within an HTTP request,
1774it is added to the regular request headers.
1775
1776For an IMAP or SMTP MIME uploaded mail built with \-\-form options, it is
1777prepended to the resulting MIME document, effectively including it at the mail
1778global level. It does not affect raw uploaded mails (Added in 7.56.0).
1779
1780You may specify any number of extra headers. Note that if you should add a
1781custom header that has the same name as one of the internal ones curl would
1782use, your externally set header will be used instead of the internal one.
1783This allows you to make even trickier stuff than curl would normally do. You
1784should not replace internally set headers without knowing perfectly well what
1785you are doing. Remove an internal header by giving a replacement without
1786content on the right side of the colon, as in: \-H "Host:". If you send the
1787custom header with no-value then its header must be terminated with a
1788semicolon, such as \-H "X-Custom-Header;" to send "X-Custom-Header:".
1789
1790curl will make sure that each header you add/replace is sent with the proper
1791end-of-line marker, you should thus \fBnot\fP add that as a part of the header
1792content: do not add newlines or carriage returns, they will only mess things
1793up for you.
1794
1795This option can take an argument in @filename style, which then adds a header
1796for each line in the input file. Using @- will make curl read the header file
1797from stdin. Added in 7.55.0.
1798
1799Please note that most anti-spam utilities check the presence and value of
1800several MIME mail headers: these are "From:", "To:", "Date:" and "Subject:"
1801among others and should be added with this option.
1802
1803You need \-\-proxy-header to send custom headers intended for an HTTP
1804proxy. Added in 7.37.0.
1805
1806Passing on a "Transfer-Encoding: chunked" header when doing an HTTP request
1807with a request body, will make curl send the data using chunked encoding.
1808
1809\fBWARNING\fP: headers set with this option will be set in all HTTP requests
1810\- even after redirects are followed, like when told with \fI\-L, \-\-location\fP. This can
1811lead to the header being sent to other hosts than the original host, so
1812sensitive headers should be used with caution combined with following
1813redirects.
1814
1815--header can be used several times in a command line
1816
1817Examples:
1818.nf
1819 curl -H "X-First-Name: Joe" https://example.com
1820 curl -H "User-Agent: yes-please/2000" https://example.com
1821 curl -H "Host:" https://example.com
1822.fi
1823
1824See also \fI-A, --user-agent\fP and \fI-e, --referer\fP.
1825.IP "\-h, \-\-help <category>"
1826Usage help. This lists all commands of the <category>.
1827If no arg was provided, curl will display the most important
1828command line arguments.
1829If the argument "all" was provided, curl will display all options available.
1830If the argument "category" was provided, curl will display all categories and
1831their meanings.
1832
1833Providing --help multiple times has no extra effect.
1834Disable it again with --no-help.
1835
1836Example:
1837.nf
1838 curl --help all
1839.fi
1840
1841See also \fI-v, --verbose\fP.
1842.IP "\-\-hostpubmd5 <md5>"
1843(SFTP SCP) Pass a string containing 32 hexadecimal digits. The string should
1844be the 128 bit MD5 checksum of the remote host's public key, curl will refuse
1845the connection with the host unless the md5sums match.
1846
1847If --hostpubmd5 is provided several times, the last set value will be used.
1848
1849Example:
1850.nf
1851 curl --hostpubmd5 e5c1c49020640a5ab0f2034854c321a8 sftp://example.com/
1852.fi
1853
1854See also \fI--hostpubsha256\fP.
1855.IP "\-\-hostpubsha256 <sha256>"
1856(SFTP SCP) Pass a string containing a Base64-encoded SHA256 hash of the remote
1857host's public key. Curl will refuse the connection with the host
1858unless the hashes match.
1859
1860If --hostpubsha256 is provided several times, the last set value will be used.
1861
1862Example:
1863.nf
1864 curl --hostpubsha256 NDVkMTQxMGQ1ODdmMjQ3MjczYjAyOTY5MmRkMjVmNDQ= sftp://example.com/
1865.fi
1866
1867See also \fI--hostpubmd5\fP. Added in 7.80.0.
1868.IP "\-\-hsts <file name>"
1869(HTTPS) This option enables HSTS for the transfer. If the file name points to an
1870existing HSTS cache file, that will be used. After a completed transfer, the
1871cache will be saved to the file name again if it has been modified.
1872
1873Specify a "" file name (zero length) to avoid loading/saving and make curl
1874just handle HSTS in memory.
1875
1876If this option is used several times, curl will load contents from all the
1877files but the last one will be used for saving.
1878
1879--hsts can be used several times in a command line
1880
1881Example:
1882.nf
1883 curl --hsts cache.txt https://example.com
1884.fi
1885
1886See also \fI--proto\fP. Added in 7.74.0.
1887.IP "\-\-http0.9"
1888(HTTP) Tells curl to be fine with HTTP version 0.9 response.
1889
1890HTTP/0.9 is a completely headerless response and therefore you can also
1891connect with this to non-HTTP servers and still get a response since curl will
1892simply transparently downgrade \- if allowed.
1893
1894Since curl 7.66.0, HTTP/0.9 is disabled by default.
1895
1896Providing --http0.9 multiple times has no extra effect.
1897Disable it again with --no-http0.9.
1898
1899Example:
1900.nf
1901 curl --http0.9 https://example.com
1902.fi
1903
1904See also \fI--http1.1\fP, \fI--http2\fP and \fI--http3\fP. Added in 7.64.0.
1905.IP "\-0, \-\-http1.0"
1906(HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred
1907HTTP version.
1908
1909Providing --http1.0 multiple times has no extra effect.
1910
1911Example:
1912.nf
1913 curl --http1.0 https://example.com
1914.fi
1915
1916See also \fI--http0.9\fP and \fI--http1.1\fP. This option is mutually exclusive to \fI--http1.1\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP and \fI--http3\fP.
1917.IP "\-\-http1.1"
1918(HTTP) Tells curl to use HTTP version 1.1.
1919
1920Providing --http1.1 multiple times has no extra effect.
1921
1922Example:
1923.nf
1924 curl --http1.1 https://example.com
1925.fi
1926
1927See also \fI-0, --http1.0\fP and \fI--http0.9\fP. This option is mutually exclusive to \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP and \fI--http3\fP. Added in 7.33.0.
1928.IP "\-\-http2-prior-knowledge"
1929(HTTP) Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1
1930Upgrade. It requires prior knowledge that the server supports HTTP/2 straight
1931away. HTTPS requests will still do HTTP/2 the standard way with negotiated
1932protocol version in the TLS handshake.
1933
1934Providing --http2-prior-knowledge multiple times has no extra effect.
1935Disable it again with --no-http2-prior-knowledge.
1936
1937Example:
1938.nf
1939 curl --http2-prior-knowledge https://example.com
1940.fi
1941
1942See also \fI--http2\fP and \fI--http3\fP. \fI--http2-prior-knowledge\fP requires that the underlying libcurl was built to support HTTP/2. This option is mutually exclusive to \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http3\fP. Added in 7.49.0.
1943.IP "\-\-http2"
1944(HTTP) Tells curl to use HTTP version 2.
1945
1946For HTTPS, this means curl will attempt to negotiate HTTP/2 in the TLS
1947handshake. curl does this by default.
1948
1949For HTTP, this means curl will attempt to upgrade the request to HTTP/2 using
1950the Upgrade: request header.
1951
1952When curl uses HTTP/2 over HTTPS, it does not itself insist on TLS 1.2 or
1953higher even though that is required by the specification. A user can add this
1954version requirement with \fI\-\-tlsv1.2\fP.
1955
1956Providing --http2 multiple times has no extra effect.
1957
1958Example:
1959.nf
1960 curl --http2 https://example.com
1961.fi
1962
1963See also \fI--http1.1\fP and \fI--http3\fP. \fI--http2\fP requires that the underlying libcurl was built to support HTTP/2. This option is mutually exclusive to \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2-prior-knowledge\fP and \fI--http3\fP. Added in 7.33.0.
1964.IP "\-\-http3"
1965(HTTP) **WARNING**: this option is experimental. Do not use in production.
1966
1967Tells curl to use HTTP version 3 directly to the host and port number used in
1968the URL. A normal HTTP/3 transaction will be done to a host and then get
1969redirected via Alt-Svc, but this option allows a user to circumvent that when
1970you know that the target speaks HTTP/3 on the given host and port.
1971
1972This option will make curl fail if a QUIC connection cannot be established, it
1973cannot fall back to a lower HTTP version on its own.
1974
1975Providing --http3 multiple times has no extra effect.
1976
1977Example:
1978.nf
1979 curl --http3 https://example.com
1980.fi
1981
1982See also \fI--http1.1\fP and \fI--http2\fP. \fI--http3\fP requires that the underlying libcurl was built to support HTTP/3. This option is mutually exclusive to \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP. Added in 7.66.0.
1983.IP "\-\-ignore-content-length"
1984(FTP HTTP) For HTTP, Ignore the Content-Length header. This is particularly useful for
1985servers running Apache 1.x, which will report incorrect Content-Length for
1986files larger than 2 gigabytes.
1987
1988For FTP (since 7.46.0), skip the RETR command to figure out the size before
1989downloading a file.
1990
1991This option does not work for HTTP if libcurl was built to use hyper.
1992
1993Providing --ignore-content-length multiple times has no extra effect.
1994Disable it again with --no-ignore-content-length.
1995
1996Example:
1997.nf
1998 curl --ignore-content-length https://example.com
1999.fi
2000
2001See also \fI--ftp-skip-pasv-ip\fP.
2002.IP "\-i, \-\-include"
2003Include the HTTP response headers in the output. The HTTP response headers can
2004include things like server name, cookies, date of the document, HTTP version
2005and more...
2006
2007To view the request headers, consider the \-\-verbose option.
2008
2009Providing --include multiple times has no extra effect.
2010Disable it again with --no-include.
2011
2012Example:
2013.nf
2014 curl -i https://example.com
2015.fi
2016
2017See also \fI-v, --verbose\fP.
2018.IP "\-k, \-\-insecure"
2019(TLS SFTP SCP) By default, every secure connection curl makes is verified to be secure before
2020the transfer takes place. This option makes curl skip the verification step
2021and proceed without checking.
2022
2023When this option is not used for protocols using TLS, curl verifies the
2024server's TLS certificate before it continues: that the certificate contains
2025the right name which matches the host name used in the URL and that the
2026certificate has been signed by a CA certificate present in the cert store.
2027See this online resource for further details:
2028.nf
2029 https://curl.se/docs/sslcerts.html
2030.fi
2031
2032For SFTP and SCP, this option makes curl skip the \fIknown_hosts\fP verification.
2033\fIknown_hosts\fP is a file normally stored in the user's home directory in the
2034\(dq.ssh" subdirectory, which contains host names and their public keys.
2035
2036\fBWARNING\fP: using this option makes the transfer insecure.
2037
2038Providing --insecure multiple times has no extra effect.
2039Disable it again with --no-insecure.
2040
2041Example:
2042.nf
2043 curl --insecure https://example.com
2044.fi
2045
2046See also \fI--proxy-insecure\fP, \fI--cacert\fP and \fI--capath\fP.
2047.IP "\-\-interface <name>"
2048Perform an operation using a specified interface. You can enter interface
2049name, IP address or host name. An example could look like:
2050
2051.nf
2052 curl \-\-interface eth0:1 https://www.example.com/
2053.fi
2054
2055On Linux it can be used to specify a VRF, but the binary needs to either
2056have CAP_NET_RAW or to be run as root. More information about Linux VRF:
2057https://www.kernel.org/doc/Documentation/networking/vrf.txt
2058
2059If --interface is provided several times, the last set value will be used.
2060
2061Example:
2062.nf
2063 curl --interface eth0 https://example.com
2064.fi
2065
2066See also \fI--dns-interface\fP.
2067.IP "\-4, \-\-ipv4"
2068This option tells curl to use IPv4 addresses only, and not for example try
2069IPv6.
2070
2071Providing --ipv4 multiple times has no extra effect.
2072Disable it again with --no-ipv4.
2073
2074Example:
2075.nf
2076 curl --ipv4 https://example.com
2077.fi
2078
2079See also \fI--http1.1\fP and \fI--http2\fP. This option is mutually exclusive to \fI-6, --ipv6\fP.
2080.IP "\-6, \-\-ipv6"
2081This option tells curl to use IPv6 addresses only, and not for example try
2082IPv4.
2083
2084Providing --ipv6 multiple times has no extra effect.
2085Disable it again with --no-ipv6.
2086
2087Example:
2088.nf
2089 curl --ipv6 https://example.com
2090.fi
2091
2092See also \fI--http1.1\fP and \fI--http2\fP. This option is mutually exclusive to \fI-4, --ipv4\fP.
2093.IP "\-\-json <data>"
2094(HTTP) Sends the specified JSON data in a POST request to the HTTP server. \-\-json
2095works as a shortcut for passing on these three options:
2096
2097.nf
2098 \-\-data [arg]
2099 \-\-header "Content-Type: application/json"
2100 \-\-header "Accept: application/json"
2101.fi
2102
2103There is \fI\fPno verification\fI\fP that the passed in data is actual JSON or that
2104the syntax is correct.
2105
2106If you start the data with the letter @, the rest should be a file name to
2107read the data from, or a single dash (-) if you want curl to read the data
2108from stdin. Posting data from a file named 'foobar' would thus be done with
2109\fI\-\-json\fP @foobar and to instead read the data from stdin, use \-\-json @-.
2110
2111If this option is used more than once on the same command line, the additional
2112data pieces will be concatenated to the previous before sending.
2113
2114The headers this option sets can be overridden with \-\-header as usual.
2115
2116--json can be used several times in a command line
2117
2118Examples:
2119.nf
2120 curl --json '{ "drink": "coffe" }' https://example.com
2121 curl --json '{ "drink":' --json ' "coffe" }' https://example.com
2122 curl --json @prepared https://example.com
2123 curl --json @- https://example.com < json.txt
2124.fi
2125
2126See also \fI--data-binary\fP and \fI--data-raw\fP. This option is mutually exclusive to \fI-F, --form\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP. Added in 7.82.0.
2127.IP "\-j, \-\-junk-session-cookies"
2128(HTTP) When curl is told to read cookies from a given file, this option will make it
2129discard all "session cookies". This will basically have the same effect as if
2130a new session is started. Typical browsers always discard session cookies when
2131they are closed down.
2132
2133Providing --junk-session-cookies multiple times has no extra effect.
2134Disable it again with --no-junk-session-cookies.
2135
2136Example:
2137.nf
2138 curl --junk-session-cookies -b cookies.txt https://example.com
2139.fi
2140
2141See also \fI-b, --cookie\fP and \fI-c, --cookie-jar\fP.
2142.IP "\-\-keepalive-time <seconds>"
2143This option sets the time a connection needs to remain idle before sending
2144keepalive probes and the time between individual keepalive probes. It is
2145currently effective on operating systems offering the TCP_KEEPIDLE and
2146TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more).
2147Keepalives are used by the TCP stack to detect broken networks on idle
2148connections. The number of missed keepalive probes before declaring the
2149connection down is OS dependent and is commonly 9 or 10. This option has no
2150effect if \-\-no-keepalive is used.
2151
2152If unspecified, the option defaults to 60 seconds.
2153
2154If --keepalive-time is provided several times, the last set value will be used.
2155
2156Example:
2157.nf
2158 curl --keepalive-time 20 https://example.com
2159.fi
2160
2161See also \fI--no-keepalive\fP and \fI-m, --max-time\fP.
2162.IP "\-\-key-type <type>"
2163(TLS) Private key file type. Specify which type your \-\-key provided private key
2164is. DER, PEM, and ENG are supported. If not specified, PEM is assumed.
2165
2166If --key-type is provided several times, the last set value will be used.
2167
2168Example:
2169.nf
2170 curl --key-type DER --key here https://example.com
2171.fi
2172
2173See also \fI--key\fP.
2174.IP "\-\-key <key>"
2175(TLS SSH) Private key file name. Allows you to provide your private key in this separate
2176file. For SSH, if not specified, curl tries the following candidates in order:
2177\(aq~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
2178
2179If curl is built against OpenSSL library, and the engine pkcs11 is available,
2180then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a
2181PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
2182PKCS#11 URI. If a PKCS#11 URI is provided, then the \-\-engine option will be set
2183as "pkcs11" if none was provided and the \-\-key-type option will be set as
2184\(dqENG" if none was provided.
2185
2186If curl is built against Secure Transport or Schannel then this option is
2187ignored for TLS protocols (HTTPS, etc). Those backends expect the private key
2188to be already present in the keychain or PKCS#12 file containing the
2189certificate.
2190
2191If --key is provided several times, the last set value will be used.
2192
2193Example:
2194.nf
2195 curl --cert certificate --key here https://example.com
2196.fi
2197
2198See also \fI--key-type\fP and \fI-E, --cert\fP.
2199.IP "\-\-krb <level>"
2200(FTP) Enable Kerberos authentication and use. The level must be entered and should
2201be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a
2202level that is not one of these, 'private' will instead be used.
2203
2204If --krb is provided several times, the last set value will be used.
2205
2206Example:
2207.nf
2208 curl --krb clear ftp://example.com/
2209.fi
2210
2211See also \fI--delegation\fP and \fI--ssl\fP. \fI--krb\fP requires that the underlying libcurl was built to support Kerberos.
2212.IP "\-\-libcurl <file>"
2213Append this option to any ordinary curl command line, and you will get
2214libcurl-using C source code written to the file that does the equivalent
2215of what your command-line operation does!
2216
2217This option is global and does not need to be specified for each use of
2218\fI\-:, \-\-next\fP.
2219
2220If --libcurl is provided several times, the last set value will be used.
2221
2222Example:
2223.nf
2224 curl --libcurl client.c https://example.com
2225.fi
2226
2227See also \fI-v, --verbose\fP.
2228.IP "\-\-limit-rate <speed>"
2229Specify the maximum transfer rate you want curl to use \- for both downloads
2230and uploads. This feature is useful if you have a limited pipe and you would like
2231your transfer not to use your entire bandwidth. To make it slower than it
2232otherwise would be.
2233
2234The given speed is measured in bytes/second, unless a suffix is appended.
2235Appending 'k' or 'K' will count the number as kilobytes, 'm' or 'M' makes it
2236megabytes, while 'g' or 'G' makes it gigabytes. The suffixes (k, M, G, T, P)
2237are 1024 based. For example 1k is 1024. Examples: 200K, 3m and 1G.
2238
2239The rate limiting logic works on averaging the transfer speed to no more than
2240the set threshold over a period of multiple seconds.
2241
2242If you also use the \-\-speed-limit option, that option will take precedence and
2243might cripple the rate-limiting slightly, to help keeping the speed-limit
2244logic working.
2245
2246If --limit-rate is provided several times, the last set value will be used.
2247
2248Examples:
2249.nf
2250 curl --limit-rate 100K https://example.com
2251 curl --limit-rate 1000 https://example.com
2252 curl --limit-rate 10M https://example.com
2253.fi
2254
2255See also \fI-Y, --speed-limit\fP and \fI-y, --speed-time\fP.
2256.IP "\-l, \-\-list-only"
2257(FTP POP3) (FTP)
2258When listing an FTP directory, this switch forces a name-only view. This is
2259especially useful if the user wants to machine-parse the contents of an FTP
2260directory since the normal directory view does not use a standard look or
2261format. When used like this, the option causes an NLST command to be sent to
2262the server instead of LIST.
2263
2264Note: Some FTP servers list only files in their response to NLST; they do not
2265include sub-directories and symbolic links.
2266
2267(POP3)
2268When retrieving a specific email from POP3, this switch forces a LIST command
2269to be performed instead of RETR. This is particularly useful if the user wants
2270to see if a specific message-id exists on the server and what size it is.
2271
2272Note: When combined with \fI\-X, \-\-request\fP, this option can be used to send a UIDL
2273command instead, so the user may use the email's unique identifier rather than
2274its message-id to make the request.
2275
2276Providing --list-only multiple times has no extra effect.
2277Disable it again with --no-list-only.
2278
2279Example:
2280.nf
2281 curl --list-only ftp://example.com/dir/
2282.fi
2283
2284See also \fI-Q, --quote\fP and \fI-X, --request\fP.
2285.IP "\-\-local-port <num/range>"
2286Set a preferred single number or range (FROM-TO) of local port numbers to use
2287for the connection(s). Note that port numbers by nature are a scarce resource
2288that will be busy at times so setting this range to something too narrow might
2289cause unnecessary connection setup failures.
2290
2291If --local-port is provided several times, the last set value will be used.
2292
2293Example:
2294.nf
2295 curl --local-port 1000-3000 https://example.com
2296.fi
2297
2298See also \fI-g, --globoff\fP.
2299.IP "\-\-location-trusted"
2300(HTTP) Like \fI\-L, \-\-location\fP, but will allow sending the name + password to all hosts that
2301the site may redirect to. This may or may not introduce a security breach if
2302the site redirects you to a site to which you will send your authentication
2303info (which is plaintext in the case of HTTP Basic authentication).
2304
2305Providing --location-trusted multiple times has no extra effect.
2306Disable it again with --no-location-trusted.
2307
2308Example:
2309.nf
2310 curl --location-trusted -u user:password https://example.com
2311.fi
2312
2313See also \fI-u, --user\fP.
2314.IP "\-L, \-\-location"
2315(HTTP) If the server reports that the requested page has moved to a different
2316location (indicated with a Location: header and a 3XX response code), this
2317option will make curl redo the request on the new place. If used together with
2318\-\-include or \fI\-I, \-\-head\fP, headers from all requested pages will be shown. When
2319authentication is used, curl only sends its credentials to the initial
2320host. If a redirect takes curl to a different host, it will not be able to
2321intercept the user+password. See also \-\-location-trusted on how to change
2322this. You can limit the amount of redirects to follow by using the
2323\-\-max-redirs option.
2324
2325When curl follows a redirect and if the request is a POST, it will send the
2326following request with a GET if the HTTP response was 301, 302, or 303. If the
2327response code was any other 3xx code, curl will re-send the following request
2328using the same unmodified method.
2329
2330You can tell curl to not change POST requests to GET after a 30x response by
2331using the dedicated options for that: \fI\-\-post301\fP, \-\-post302 and \fI\-\-post303\fP.
2332
2333The method set with \-\-request overrides the method curl would otherwise select
2334to use.
2335
2336Providing --location multiple times has no extra effect.
2337Disable it again with --no-location.
2338
2339Example:
2340.nf
2341 curl -L https://example.com
2342.fi
2343
2344See also \fI--resolve\fP and \fI--alt-svc\fP.
2345.IP "\-\-login-options <options>"
2346(IMAP LDAP POP3 SMTP) Specify the login options to use during server authentication.
2347
2348You can use login options to specify protocol specific options that may be
2349used during authentication. At present only IMAP, POP3 and SMTP support
2350login options. For more information about login options please see RFC
23512384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt
2352
2353If --login-options is provided several times, the last set value will be used.
2354
2355Example:
2356.nf
2357 curl --login-options 'AUTH=*' imap://example.com
2358.fi
2359
2360See also \fI-u, --user\fP. Added in 7.34.0.
2361.IP "\-\-mail-auth <address>"
2362(SMTP) Specify a single address. This will be used to specify the authentication
2363address (identity) of a submitted message that is being relayed to another
2364server.
2365
2366If --mail-auth is provided several times, the last set value will be used.
2367
2368Example:
2369.nf
2370 curl --mail-auth user@example.come -T mail smtp://example.com/
2371.fi
2372
2373See also \fI--mail-rcpt\fP and \fI--mail-from\fP.
2374.IP "\-\-mail-from <address>"
2375(SMTP) Specify a single address that the given mail should get sent from.
2376
2377If --mail-from is provided several times, the last set value will be used.
2378
2379Example:
2380.nf
2381 curl --mail-from user@example.com -T mail smtp://example.com/
2382.fi
2383
2384See also \fI--mail-rcpt\fP and \fI--mail-auth\fP.
2385.IP "\-\-mail-rcpt-allowfails"
2386(SMTP) When sending data to multiple recipients, by default curl will abort SMTP
2387conversation if at least one of the recipients causes RCPT TO command to
2388return an error.
2389
2390The default behavior can be changed by passing \-\-mail-rcpt-allowfails
2391command-line option which will make curl ignore errors and proceed with the
2392remaining valid recipients.
2393
2394If all recipients trigger RCPT TO failures and this flag is specified, curl
2395will still abort the SMTP conversation and return the error received from to
2396the last RCPT TO command.
2397
2398Providing --mail-rcpt-allowfails multiple times has no extra effect.
2399Disable it again with --no-mail-rcpt-allowfails.
2400
2401Example:
2402.nf
2403 curl --mail-rcpt-allowfails --mail-rcpt dest@example.com smtp://example.com
2404.fi
2405
2406See also \fI--mail-rcpt\fP. Added in 7.69.0.
2407.IP "\-\-mail-rcpt <address>"
2408(SMTP) Specify a single email address, user name or mailing list name. Repeat this
2409option several times to send to multiple recipients.
2410
2411When performing an address verification (VRFY command), the recipient should be
2412specified as the user name or user name and domain (as per Section 3.5 of
2413RFC5321). (Added in 7.34.0)
2414
2415When performing a mailing list expand (EXPN command), the recipient should be
2416specified using the mailing list name, such as "Friends" or "London-Office".
2417(Added in 7.34.0)
2418
2419--mail-rcpt can be used several times in a command line
2420
2421Example:
2422.nf
2423 curl --mail-rcpt user@example.net smtp://example.com
2424.fi
2425
2426See also \fI--mail-rcpt-allowfails\fP.
2427.IP "\-M, \-\-manual"
2428Manual. Display the huge help text.
2429
2430Providing --manual multiple times has no extra effect.
2431Disable it again with --no-manual.
2432
2433Example:
2434.nf
2435 curl --manual
2436.fi
2437
2438See also \fI-v, --verbose\fP, \fI--libcurl\fP and \fI--trace\fP.
2439.IP "\-\-max-filesize <bytes>"
2440(FTP HTTP MQTT) Specify the maximum size (in bytes) of a file to download. If the file
2441requested is larger than this value, the transfer will not start and curl will
2442return with exit code 63.
2443
2444A size modifier may be used. For example, Appending 'k' or 'K' will count the
2445number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it
2446gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0)
2447
2448\fBNOTE\fP: The file size is not always known prior to download, and for such
2449files this option has no effect even if the file transfer ends up being larger
2450than this given limit.
2451If --max-filesize is provided several times, the last set value will be used.
2452
2453Example:
2454.nf
2455 curl --max-filesize 100K https://example.com
2456.fi
2457
2458See also \fI--limit-rate\fP.
2459.IP "\-\-max-redirs <num>"
2460(HTTP) Set maximum number of redirections to follow. When \-\-location is used, to
2461prevent curl from following too many redirects, by default, the limit is
2462set to 50 redirects. Set this option to \-1 to make it unlimited.
2463
2464If --max-redirs is provided several times, the last set value will be used.
2465
2466Example:
2467.nf
2468 curl --max-redirs 3 --location https://example.com
2469.fi
2470
2471See also \fI-L, --location\fP.
2472.IP "\-m, \-\-max-time <fractional seconds>"
2473Maximum time in seconds that you allow each transfer to take. This is
2474useful for preventing your batch jobs from hanging for hours due to slow
2475networks or links going down. Since 7.32.0, this option accepts decimal
2476values, but the actual timeout will decrease in accuracy as the specified
2477timeout increases in decimal precision.
2478
2479If you enable retrying the transfer (\fI\-\-retry\fP) then the maximum time counter is
2480reset each time the transfer is retried. You can use \-\-retry-max-time to limit
2481the retry time.
2482
2483If --max-time is provided several times, the last set value will be used.
2484
2485Examples:
2486.nf
2487 curl --max-time 10 https://example.com
2488 curl --max-time 2.92 https://example.com
2489.fi
2490
2491See also \fI--connect-timeout\fP and \fI--retry-max-time\fP.
2492.IP "\-\-metalink"
2493This option was previously used to specify a metalink resource. Metalink
2494support has been disabled in curl since 7.78.0 for security reasons.
2495
2496If --metalink is provided several times, the last set value will be used.
2497
2498Example:
2499.nf
2500 curl --metalink file https://example.com
2501.fi
2502
2503See also \fI-Z, --parallel\fP.
2504.IP "\-\-negotiate"
2505(HTTP) Enables Negotiate (SPNEGO) authentication.
2506
2507This option requires a library built with GSS-API or SSPI support. Use
2508\-\-version to see if your curl supports GSS-API/SSPI or SPNEGO.
2509
2510When using this option, you must also provide a fake \-\-user option to activate
2511the authentication code properly. Sending a '-u :' is enough as the user name
2512and password from the \-\-user option are not actually used.
2513
2514If this option is used several times, only the first one is used.
2515
2516Providing --negotiate multiple times has no extra effect.
2517
2518Example:
2519.nf
2520 curl --negotiate -u : https://example.com
2521.fi
2522
2523See also \fI--basic\fP, \fI--ntlm\fP, \fI--anyauth\fP and \fI--proxy-negotiate\fP.
2524.IP "\-\-netrc-file <filename>"
2525This option is similar to \fI\-n, \-\-netrc\fP, except that you provide the path (absolute
2526or relative) to the netrc file that curl should use. You can only specify one
2527netrc file per invocation.
2528
2529It will abide by \-\-netrc-optional if specified.
2530
2531If --netrc-file is provided several times, the last set value will be used.
2532
2533Example:
2534.nf
2535 curl --netrc-file netrc https://example.com
2536.fi
2537
2538See also \fI-n, --netrc\fP, \fI-u, --user\fP and \fI-K, --config\fP. This option is mutually exclusive to \fI-n, --netrc\fP.
2539.IP "\-\-netrc-optional"
2540Similar to \fI\-n, \-\-netrc\fP, but this option makes the .netrc usage \fBoptional\fP
2541and not mandatory as the \-\-netrc option does.
2542
2543Providing --netrc-optional multiple times has no extra effect.
2544Disable it again with --no-netrc-optional.
2545
2546Example:
2547.nf
2548 curl --netrc-optional https://example.com
2549.fi
2550
2551See also \fI--netrc-file\fP. This option is mutually exclusive to \fI-n, --netrc\fP.
2552.IP "\-n, \-\-netrc"
2553Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's home
2554directory for login name and password. This is typically used for FTP on
2555Unix. If used with HTTP, curl will enable user authentication. See
2556\fInetrc(5)\fP and \fIftp(1)\fP for details on the file format. Curl will not
2557complain if that file does not have the right permissions (it should be
2558neither world- nor group-readable). The environment variable "HOME" is used
2559to find the home directory.
2560
2561A quick and simple example of how to setup a \fI.netrc\fP to allow curl to FTP to
2562the machine host.domain.com with user name 'myself' and password 'secret'
2563could look similar to:
2564
2565.nf
2566 machine host.domain.com
2567 login myself
2568 password secret
2569.fi
2570
2571Providing --netrc multiple times has no extra effect.
2572Disable it again with --no-netrc.
2573
2574Example:
2575.nf
2576 curl --netrc https://example.com
2577.fi
2578
2579See also \fI--netrc-file\fP, \fI-K, --config\fP and \fI-u, --user\fP.
2580.IP "\-:, \-\-next"
2581Tells curl to use a separate operation for the following URL and associated
2582options. This allows you to send several URL requests, each with their own
2583specific options, for example, such as different user names or custom requests
2584for each.
2585
2586\-\-next will reset all local options and only global ones will have their
2587values survive over to the operation following the \-\-next instruction. Global
2588options include \fI\-v, \-\-verbose\fP, \fI\-\-trace\fP, \-\-trace-ascii and \fI\-\-fail-early\fP.
2589
2590For example, you can do both a GET and a POST in a single command line:
2591
2592.nf
2593 curl www1.example.com \-\-next \-d postthis www2.example.com
2594.fi
2595
2596--next can be used several times in a command line
2597
2598Examples:
2599.nf
2600 curl https://example.com --next -d postthis www2.example.com
2601 curl -I https://example.com --next https://example.net/
2602.fi
2603
2604See also \fI-Z, --parallel\fP and \fI-K, --config\fP. Added in 7.36.0.
2605.IP "\-\-no-alpn"
2606(HTTPS) Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built
2607with an SSL library that supports ALPN. ALPN is used by a libcurl that supports
2608HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
2609
2610Providing --no-alpn multiple times has no extra effect.
2611Disable it again with --alpn.
2612
2613Example:
2614.nf
2615 curl --no-alpn https://example.com
2616.fi
2617
2618See 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.
2619.IP "\-N, \-\-no-buffer"
2620Disables the buffering of the output stream. In normal work situations, curl
2621will use a standard buffered output stream that will have the effect that it
2622will output the data in chunks, not necessarily exactly when the data arrives.
2623Using this option will disable that buffering.
2624
2625Providing --no-buffer multiple times has no extra effect.
2626Disable it again with --buffer.
2627
2628Example:
2629.nf
2630 curl --no-buffer https://example.com
2631.fi
2632
2633See also \fI-#, --progress-bar\fP.
2634.IP "\-\-no-clobber"
2635When used in conjunction with the \fI\-o, \-\-output\fP, \fI\-J, \-\-remote-header-name\fP,
2636\fI\-O, \-\-remote-name\fP, or \-\-remote-name-all options, curl avoids overwriting files
2637that already exist. Instead, a dot and a number gets appended to the name
2638of the file that would be created, up to filename.100 after which it will not
2639create any file.
2640
2641Note that this is the negated option name documented. You can thus use
2642\-\-clobber to enforce the clobbering, even if \-\-remote-header-name or \-J is
2643specified.
2644
2645Providing --no-clobber multiple times has no extra effect.
2646Disable it again with --clobber.
2647
2648Example:
2649.nf
2650 curl --no-clobber --output local/dir/file https://example.com
2651.fi
2652
2653See also \fI-o, --output\fP and \fI-O, --remote-name\fP. Added in 7.83.0.
2654.IP "\-\-no-keepalive"
2655Disables the use of keepalive messages on the TCP connection. curl otherwise
2656enables them by default.
2657
2658Note that this is the negated option name documented. You can thus use
2659\-\-keepalive to enforce keepalive.
2660
2661Providing --no-keepalive multiple times has no extra effect.
2662Disable it again with --keepalive.
2663
2664Example:
2665.nf
2666 curl --no-keepalive https://example.com
2667.fi
2668
2669See also \fI--keepalive-time\fP.
2670.IP "\-\-no-npn"
2671(HTTPS) In curl 7.86.0 and later, curl never uses NPN.
2672
2673Disable the NPN TLS extension. NPN is enabled by default if libcurl was built
2674with an SSL library that supports NPN. NPN is used by a libcurl that supports
2675HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
2676
2677Providing --no-npn multiple times has no extra effect.
2678Disable it again with --npn.
2679
2680Example:
2681.nf
2682 curl --no-npn https://example.com
2683.fi
2684
2685See 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.
2686.IP "\-\-no-progress-meter"
2687Option to switch off the progress meter output without muting or otherwise
2688affecting warning and informational messages like \-\-silent does.
2689
2690Note that this is the negated option name documented. You can thus use
2691\-\-progress-meter to enable the progress meter again.
2692
2693Providing --no-progress-meter multiple times has no extra effect.
2694Disable it again with --progress-meter.
2695
2696Example:
2697.nf
2698 curl --no-progress-meter -o store https://example.com
2699.fi
2700
2701See also \fI-v, --verbose\fP and \fI-s, --silent\fP. Added in 7.67.0.
2702.IP "\-\-no-sessionid"
2703(TLS) Disable curl's use of SSL session-ID caching. By default all transfers are
2704done using the cache. Note that while nothing should ever get hurt by
2705attempting to reuse SSL session-IDs, there seem to be broken SSL
2706implementations in the wild that may require you to disable this in order for
2707you to succeed.
2708
2709Note that this is the negated option name documented. You can thus use
2710\-\-sessionid to enforce session-ID caching.
2711
2712Providing --no-sessionid multiple times has no extra effect.
2713Disable it again with --sessionid.
2714
2715Example:
2716.nf
2717 curl --no-sessionid https://example.com
2718.fi
2719
2720See also \fI-k, --insecure\fP.
2721.IP "\-\-noproxy <no-proxy-list>"
2722Comma-separated list of hosts for which not to use a proxy, if one is
2723specified. The only wildcard is a single * character, which matches all hosts,
2724and effectively disables the proxy. Each name in this list is matched as
2725either a domain which contains the hostname, or the hostname itself. For
2726example, local.com would match local.com, local.com:80, and www.local.com, but
2727not www.notlocal.com.
2728
2729Since 7.53.0, This option overrides the environment variables that disable the
2730proxy ('no_proxy' and 'NO_PROXY'). If there's an environment variable
2731disabling a proxy, you can set the noproxy list to "" to override it.
2732
2733If --noproxy is provided several times, the last set value will be used.
2734
2735Example:
2736.nf
2737 curl --noproxy "www.example" https://example.com
2738.fi
2739
2740See also \fI-x, --proxy\fP.
2741.IP "\-\-ntlm-wb"
2742(HTTP) Enables NTLM much in the style \-\-ntlm does, but hand over the authentication
2743to the separate binary ntlmauth application that is executed when needed.
2744
2745Providing --ntlm-wb multiple times has no extra effect.
2746
2747Example:
2748.nf
2749 curl --ntlm-wb -u user:password https://example.com
2750.fi
2751
2752See also \fI--ntlm\fP and \fI--proxy-ntlm\fP.
2753.IP "\-\-ntlm"
2754(HTTP) Enables NTLM authentication. The NTLM authentication method was designed by
2755Microsoft and is used by IIS web servers. It is a proprietary protocol,
2756reverse-engineered by clever people and implemented in curl based on their
2757efforts. This kind of behavior should not be endorsed, you should encourage
2758everyone who uses NTLM to switch to a public and documented authentication
2759method instead, such as Digest.
2760
2761If you want to enable NTLM for your proxy authentication, then use
2762\fI\-\-proxy-ntlm\fP.
2763
2764If this option is used several times, only the first one is used.
2765
2766Providing --ntlm multiple times has no extra effect.
2767
2768Example:
2769.nf
2770 curl --ntlm -u user:password https://example.com
2771.fi
2772
2773See also \fI--proxy-ntlm\fP. \fI--ntlm\fP requires that the underlying libcurl was built to support TLS. This option is mutually exclusive to \fI--basic\fP and \fI--negotiate\fP and \fI--digest\fP and \fI--anyauth\fP.
2774.IP "\-\-oauth2-bearer <token>"
2775(IMAP LDAP POP3 SMTP HTTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token
2776is used in conjunction with the user name which can be specified as part of
2777the \-\-url or \-\-user options.
2778
2779The Bearer Token and user name are formatted according to RFC 6750.
2780
2781If --oauth2-bearer is provided several times, the last set value will be used.
2782
2783Example:
2784.nf
2785 curl --oauth2-bearer "mF_9.B5f-4.1JqM" https://example.com
2786.fi
2787
2788See also \fI--basic\fP, \fI--ntlm\fP and \fI--digest\fP. Added in 7.33.0.
2789.IP "\-\-output-dir <dir>"
2790This option specifies the directory in which files should be stored, when
2791\-\-remote-name or \-\-output are used.
2792
2793The given output directory is used for all URLs and output options on the
2794command line, up until the first \fI\-:, \-\-next\fP.
2795
2796If the specified target directory does not exist, the operation will fail
2797unless \-\-create-dirs is also used.
2798
2799If --output-dir is provided several times, the last set value will be used.
2800
2801Example:
2802.nf
2803 curl --output-dir "tmp" -O https://example.com
2804.fi
2805
2806See also \fI-O, --remote-name\fP and \fI-J, --remote-header-name\fP. Added in 7.73.0.
2807.IP "\-o, \-\-output <file>"
2808Write output to <file> instead of stdout. If you are using {} or [] to fetch
2809multiple documents, you should quote the URL and you can use '#' followed by a
2810number in the <file> specifier. That variable will be replaced with the current
2811string for the URL being fetched. Like in:
2812
2813.nf
2814 curl "http://{one,two}.example.com" \-o "file_#1.txt"
2815.fi
2816
2817or use several variables like:
2818
2819.nf
2820 curl "http://{site,host}.host[1-5].com" \-o "#1_#2"
2821.fi
2822
2823You may use this option as many times as the number of URLs you have. For
2824example, if you specify two URLs on the same command line, you can use it like
2825this:
2826
2827.nf
2828 curl \-o aa example.com \-o bb example.net
2829.fi
2830
2831and the order of the \-o options and the URLs does not matter, just that the
2832first \-o is for the first URL and so on, so the above command line can also be
2833written as
2834
2835.nf
2836 curl example.com example.net \-o aa \-o bb
2837.fi
2838
2839See also the \-\-create-dirs option to create the local directories
2840dynamically. Specifying the output as '-' (a single dash) will force the
2841output to be done to stdout.
2842
2843To suppress response bodies, you can redirect output to /dev/null:
2844
2845.nf
2846 curl example.com \-o /dev/null
2847.fi
2848
2849Or for Windows use nul:
2850
2851.nf
2852 curl example.com \-o nul
2853.fi
2854
2855--output can be used several times in a command line
2856
2857Examples:
2858.nf
2859 curl -o file https://example.com
2860 curl "http://{one,two}.example.com" -o "file_#1.txt"
2861 curl "http://{site,host}.host[1-5].com" -o "#1_#2"
2862 curl -o file https://example.com -o file2 https://example.net
2863.fi
2864
2865See also \fI-O, --remote-name\fP, \fI--remote-name-all\fP and \fI-J, --remote-header-name\fP.
2866.IP "\-\-parallel-immediate"
2867When doing parallel transfers, this option will instruct curl that it should
2868rather prefer opening up more connections in parallel at once rather than
2869waiting to see if new transfers can be added as multiplexed streams on another
2870connection.
2871
2872This option is global and does not need to be specified for each use of
2873\fI\-:, \-\-next\fP.
2874
2875Providing --parallel-immediate multiple times has no extra effect.
2876Disable it again with --no-parallel-immediate.
2877
2878Example:
2879.nf
2880 curl --parallel-immediate -Z https://example.com -o file1 https://example.com -o file2
2881.fi
2882
2883See also \fI-Z, --parallel\fP and \fI--parallel-max\fP. Added in 7.68.0.
2884.IP "\-\-parallel-max <num>"
2885When asked to do parallel transfers, using \fI\-Z, \-\-parallel\fP, this option controls
2886the maximum amount of transfers to do simultaneously.
2887
2888This option is global and does not need to be specified for each use of
2889\fI\-:, \-\-next\fP.
2890
2891The default is 50.
2892
2893If --parallel-max is provided several times, the last set value will be used.
2894
2895Example:
2896.nf
2897 curl --parallel-max 100 -Z https://example.com ftp://example.com/
2898.fi
2899
2900See also \fI-Z, --parallel\fP. Added in 7.66.0.
2901.IP "\-Z, \-\-parallel"
2902Makes curl perform its transfers in parallel as compared to the regular serial
2903manner.
2904
2905This option is global and does not need to be specified for each use of
2906\fI\-:, \-\-next\fP.
2907
2908Providing --parallel multiple times has no extra effect.
2909Disable it again with --no-parallel.
2910
2911Example:
2912.nf
2913 curl --parallel https://example.com -o file1 https://example.com -o file2
2914.fi
2915
2916See also \fI-:, --next\fP and \fI-v, --verbose\fP. Added in 7.66.0.
2917.IP "\-\-pass <phrase>"
2918(SSH TLS) Passphrase for the private key.
2919
2920If --pass is provided several times, the last set value will be used.
2921
2922Example:
2923.nf
2924 curl --pass secret --key file https://example.com
2925.fi
2926
2927See also \fI--key\fP and \fI-u, --user\fP.
2928.IP "\-\-path-as-is"
2929Tell curl to not handle sequences of /../ or /./ in the given URL
2930path. Normally curl will squash or merge them according to standards but with
2931this option set you tell it not to do that.
2932
2933Providing --path-as-is multiple times has no extra effect.
2934Disable it again with --no-path-as-is.
2935
2936Example:
2937.nf
2938 curl --path-as-is https://example.com/../../etc/passwd
2939.fi
2940
2941See also \fI--request-target\fP. Added in 7.42.0.
2942.IP "\-\-pinnedpubkey <hashes>"
2943(TLS) Tells curl to use the specified public key file (or hashes) to verify the
2944peer. This can be a path to a file which contains a single public key in PEM
2945or DER format, or any number of base64 encoded sha256 hashes preceded by
2946\(aqsha256//' and separated by ';'.
2947
2948When negotiating a TLS or SSL connection, the server sends a certificate
2949indicating its identity. A public key is extracted from this certificate and
2950if it does not exactly match the public key provided to this option, curl will
2951abort the connection before sending or receiving any data.
2952
2953PEM/DER support:
2954
29557.39.0: OpenSSL, GnuTLS and GSKit
2956
29577.43.0: NSS and wolfSSL
2958
29597.47.0: mbedtls
2960
2961sha256 support:
2962
29637.44.0: OpenSSL, GnuTLS, NSS and wolfSSL
2964
29657.47.0: mbedtls
2966
2967Other SSL backends not supported.
2968
2969If --pinnedpubkey is provided several times, the last set value will be used.
2970
2971Examples:
2972.nf
2973 curl --pinnedpubkey keyfile https://example.com
2974 curl --pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com
2975.fi
2976
2977See also \fI--hostpubsha256\fP. Added in 7.39.0.
2978.IP "\-\-post301"
2979(HTTP) Tells curl to respect RFC 7231/6.4.2 and not convert POST requests into GET
2980requests when following a 301 redirection. The non-RFC behavior is ubiquitous
2981in web browsers, so curl does the conversion by default to maintain
2982consistency. However, a server may require a POST to remain a POST after such
2983a redirection. This option is meaningful only when using \fI\-L, \-\-location\fP.
2984
2985Providing --post301 multiple times has no extra effect.
2986Disable it again with --no-post301.
2987
2988Example:
2989.nf
2990 curl --post301 --location -d "data" https://example.com
2991.fi
2992
2993See also \fI--post302\fP, \fI--post303\fP and \fI-L, --location\fP.
2994.IP "\-\-post302"
2995(HTTP) Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET
2996requests when following a 302 redirection. The non-RFC behavior is ubiquitous
2997in web browsers, so curl does the conversion by default to maintain
2998consistency. However, a server may require a POST to remain a POST after such
2999a redirection. This option is meaningful only when using \fI\-L, \-\-location\fP.
3000
3001Providing --post302 multiple times has no extra effect.
3002Disable it again with --no-post302.
3003
3004Example:
3005.nf
3006 curl --post302 --location -d "data" https://example.com
3007.fi
3008
3009See also \fI--post301\fP, \fI--post303\fP and \fI-L, --location\fP.
3010.IP "\-\-post303"
3011(HTTP) Tells curl to violate RFC 7231/6.4.4 and not convert POST requests into GET
3012requests when following 303 redirections. A server may require a POST to
3013remain a POST after a 303 redirection. This option is meaningful only when
3014using \fI\-L, \-\-location\fP.
3015
3016Providing --post303 multiple times has no extra effect.
3017Disable it again with --no-post303.
3018
3019Example:
3020.nf
3021 curl --post303 --location -d "data" https://example.com
3022.fi
3023
3024See also \fI--post302\fP, \fI--post301\fP and \fI-L, --location\fP.
3025.IP "\-\-preproxy [protocol://]host[:port]"
3026Use the specified SOCKS proxy before connecting to an HTTP or HTTPS \fI\-x, \-\-proxy\fP. In
3027such a case curl first connects to the SOCKS proxy and then connects (through
3028SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy.
3029
3030The pre proxy string should be specified with a protocol:// prefix to specify
3031alternative proxy protocols. Use socks4://, socks4a://, socks5:// or
3032socks5h:// to request the specific SOCKS version to be used. No protocol
3033specified will make curl default to SOCKS4.
3034
3035If the port number is not specified in the proxy string, it is assumed to be
30361080.
3037
3038User and password that might be provided in the proxy string are URL decoded
3039by curl. This allows you to pass in special characters such as @ by using %40
3040or pass in a colon with %3a.
3041
3042If --preproxy is provided several times, the last set value will be used.
3043
3044Example:
3045.nf
3046 curl --preproxy socks5://proxy.example -x http://http.example https://example.com
3047.fi
3048
3049See also \fI-x, --proxy\fP and \fI--socks5\fP. Added in 7.52.0.
3050.IP "\-#, \-\-progress-bar"
3051Make curl display transfer progress as a simple progress bar instead of the
3052standard, more informational, meter.
3053
3054This progress bar draws a single line of '#' characters across the screen and
3055shows a percentage if the transfer size is known. For transfers without a
3056known size, there will be space ship (-=o=-) that moves back and forth but
3057only while data is being transferred, with a set of flying hash sign symbols on
3058top.
3059
3060This option is global and does not need to be specified for each use of
3061\fI\-:, \-\-next\fP.
3062
3063Providing --progress-bar multiple times has no extra effect.
3064Disable it again with --no-progress-bar.
3065
3066Example:
3067.nf
3068 curl -# -O https://example.com
3069.fi
3070
3071See also \fI--styled-output\fP.
3072.IP "\-\-proto-default <protocol>"
3073Tells curl to use \fIprotocol\fP for any URL missing a scheme name.
3074
3075An unknown or unsupported protocol causes error
3076\fICURLE_UNSUPPORTED_PROTOCOL\fP (1).
3077
3078This option does not change the default proxy protocol (http).
3079
3080Without this option set, curl guesses protocol based on the host name, see
3081\-\-url for details.
3082
3083If --proto-default is provided several times, the last set value will be used.
3084
3085Example:
3086.nf
3087 curl --proto-default https ftp.example.com
3088.fi
3089
3090See also \fI--proto\fP and \fI--proto-redir\fP. Added in 7.45.0.
3091.IP "\-\-proto-redir <protocols>"
3092Tells curl to limit what protocols it may use on redirect. Protocols denied by
3093\-\-proto are not overridden by this option. See \-\-proto for how protocols are
3094represented.
3095
3096Example, allow only HTTP and HTTPS on redirect:
3097
3098.nf
3099 curl \-\-proto-redir \-all,http,https http://example.com
3100.fi
3101
3102By default curl will only allow HTTP, HTTPS, FTP and FTPS on redirect (since
31037.65.2). Specifying \fIall\fP or \fI+all\fP enables all protocols on redirects, which
3104is not good for security.
3105
3106If --proto-redir is provided several times, the last set value will be used.
3107
3108Example:
3109.nf
3110 curl --proto-redir =http,https https://example.com
3111.fi
3112
3113See also \fI--proto\fP.
3114.IP "\-\-proto <protocols>"
3115Tells curl to limit what protocols it may use for transfers. Protocols are
3116evaluated left to right, are comma separated, and are each a protocol name or
3117\(aqall', optionally prefixed by zero or more modifiers. Available modifiers are:
3118.RS
3119.TP 3
3120.B +
3121Permit this protocol in addition to protocols already permitted (this is
3122the default if no modifier is used).
3123.TP
3124.B \-
3125Deny this protocol, removing it from the list of protocols already permitted.
3126.TP
3127.B =
3128Permit only this protocol (ignoring the list already permitted), though
3129subject to later modification by subsequent entries in the comma separated
3130list.
3131.RE
3132.IP
3133For example:
3134.RS
3135.TP 15
3136.B \fI\-\-proto\fP \-ftps
3137uses the default protocols, but disables ftps
3138.TP
3139.B \fI\-\-proto\fP \-all,https,+http
3140only enables http and https
3141.TP
3142.B \fI\-\-proto\fP =http,https
3143also only enables http and https
3144.RE
3145.IP
3146Unknown and disabled protocols produce a warning. This allows scripts to
3147safely rely on being able to disable potentially dangerous protocols, without
3148relying upon support for that protocol being built into curl to avoid an error.
3149
3150This option can be used multiple times, in which case the effect is the same
3151as concatenating the protocols into one instance of the option.
3152
3153If --proto is provided several times, the last set value will be used.
3154
3155Example:
3156.nf
3157 curl --proto =http,https,sftp https://example.com
3158.fi
3159
3160See also \fI--proto-redir\fP and \fI--proto-default\fP.
3161.IP "\-\-proxy-anyauth"
3162Tells curl to pick a suitable authentication method when communicating with
3163the given HTTP proxy. This might cause an extra request/response round-trip.
3164
3165Providing --proxy-anyauth multiple times has no extra effect.
3166
3167Example:
3168.nf
3169 curl --proxy-anyauth --proxy-user user:passwd -x proxy https://example.com
3170.fi
3171
3172See also \fI-x, --proxy\fP, \fI--proxy-basic\fP and \fI--proxy-digest\fP.
3173.IP "\-\-proxy-basic"
3174Tells curl to use HTTP Basic authentication when communicating with the given
3175proxy. Use \-\-basic for enabling HTTP Basic with a remote host. Basic is the
3176default authentication method curl uses with proxies.
3177
3178Providing --proxy-basic multiple times has no extra effect.
3179
3180Example:
3181.nf
3182 curl --proxy-basic --proxy-user user:passwd -x proxy https://example.com
3183.fi
3184
3185See also \fI-x, --proxy\fP, \fI--proxy-anyauth\fP and \fI--proxy-digest\fP.
3186.IP "\-\-proxy-cacert <file>"
3187Same as \-\-cacert but used in HTTPS proxy context.
3188
3189If --proxy-cacert is provided several times, the last set value will be used.
3190
3191Example:
3192.nf
3193 curl --proxy-cacert CA-file.txt -x https://proxy https://example.com
3194.fi
3195
3196See also \fI--proxy-capath\fP, \fI--cacert\fP, \fI--capath\fP and \fI-x, --proxy\fP. Added in 7.52.0.
3197.IP "\-\-proxy-capath <dir>"
3198Same as \-\-capath but used in HTTPS proxy context.
3199
3200If --proxy-capath is provided several times, the last set value will be used.
3201
3202Example:
3203.nf
3204 curl --proxy-capath /local/directory -x https://proxy https://example.com
3205.fi
3206
3207See also \fI--proxy-cacert\fP, \fI-x, --proxy\fP and \fI--capath\fP. Added in 7.52.0.
3208.IP "\-\-proxy-cert-type <type>"
3209Same as \-\-cert-type but used in HTTPS proxy context.
3210
3211If --proxy-cert-type is provided several times, the last set value will be used.
3212
3213Example:
3214.nf
3215 curl --proxy-cert-type PEM --proxy-cert file -x https://proxy https://example.com
3216.fi
3217
3218See also \fI--proxy-cert\fP. Added in 7.52.0.
3219.IP "\-\-proxy-cert <cert[:passwd]>"
3220Same as \-\-cert but used in HTTPS proxy context.
3221
3222If --proxy-cert is provided several times, the last set value will be used.
3223
3224Example:
3225.nf
3226 curl --proxy-cert file -x https://proxy https://example.com
3227.fi
3228
3229See also \fI--proxy-cert-type\fP. Added in 7.52.0.
3230.IP "\-\-proxy-ciphers <list>"
3231Same as \-\-ciphers but used in HTTPS proxy context.
3232
3233If --proxy-ciphers is provided several times, the last set value will be used.
3234
3235Example:
3236.nf
3237 curl --proxy-ciphers ECDHE-ECDSA-AES256-CCM8 -x https://proxy https://example.com
3238.fi
3239
3240See also \fI--ciphers\fP, \fI--curves\fP and \fI-x, --proxy\fP. Added in 7.52.0.
3241.IP "\-\-proxy-crlfile <file>"
3242Same as \-\-crlfile but used in HTTPS proxy context.
3243
3244If --proxy-crlfile is provided several times, the last set value will be used.
3245
3246Example:
3247.nf
3248 curl --proxy-crlfile rejects.txt -x https://proxy https://example.com
3249.fi
3250
3251See also \fI--crlfile\fP and \fI-x, --proxy\fP. Added in 7.52.0.
3252.IP "\-\-proxy-digest"
3253Tells curl to use HTTP Digest authentication when communicating with the given
3254proxy. Use \-\-digest for enabling HTTP Digest with a remote host.
3255
3256Providing --proxy-digest multiple times has no extra effect.
3257
3258Example:
3259.nf
3260 curl --proxy-digest --proxy-user user:passwd -x proxy https://example.com
3261.fi
3262
3263See also \fI-x, --proxy\fP, \fI--proxy-anyauth\fP and \fI--proxy-basic\fP.
3264.IP "\-\-proxy-header <header/@file>"
3265(HTTP) Extra header to include in the request when sending HTTP to a proxy. You may
3266specify any number of extra headers. This is the equivalent option to \-\-header
3267but is for proxy communication only like in CONNECT requests when you want a
3268separate header sent to the proxy to what is sent to the actual remote host.
3269
3270curl will make sure that each header you add/replace is sent with the proper
3271end-of-line marker, you should thus \fBnot\fP add that as a part of the header
3272content: do not add newlines or carriage returns, they will only mess things
3273up for you.
3274
3275Headers specified with this option will not be included in requests that curl
3276knows will not be sent to a proxy.
3277
3278Starting in 7.55.0, this option can take an argument in @filename style, which
3279then adds a header for each line in the input file. Using @- will make curl
3280read the header file from stdin.
3281
3282This option can be used multiple times to add/replace/remove multiple headers.
3283
3284--proxy-header can be used several times in a command line
3285
3286Examples:
3287.nf
3288 curl --proxy-header "X-First-Name: Joe" -x http://proxy https://example.com
3289 curl --proxy-header "User-Agent: surprise" -x http://proxy https://example.com
3290 curl --proxy-header "Host:" -x http://proxy https://example.com
3291.fi
3292
3293See also \fI-x, --proxy\fP. Added in 7.37.0.
3294.IP "\-\-proxy-insecure"
3295Same as \-\-insecure but used in HTTPS proxy context.
3296
3297Providing --proxy-insecure multiple times has no extra effect.
3298Disable it again with --no-proxy-insecure.
3299
3300Example:
3301.nf
3302 curl --proxy-insecure -x https://proxy https://example.com
3303.fi
3304
3305See also \fI-x, --proxy\fP and \fI-k, --insecure\fP. Added in 7.52.0.
3306.IP "\-\-proxy-key-type <type>"
3307Same as \-\-key-type but used in HTTPS proxy context.
3308
3309If --proxy-key-type is provided several times, the last set value will be used.
3310
3311Example:
3312.nf
3313 curl --proxy-key-type DER --proxy-key here -x https://proxy https://example.com
3314.fi
3315
3316See also \fI--proxy-key\fP and \fI-x, --proxy\fP. Added in 7.52.0.
3317.IP "\-\-proxy-key <key>"
3318Same as \-\-key but used in HTTPS proxy context.
3319
3320If --proxy-key is provided several times, the last set value will be used.
3321
3322Example:
3323.nf
3324 curl --proxy-key here -x https://proxy https://example.com
3325.fi
3326
3327See also \fI--proxy-key-type\fP and \fI-x, --proxy\fP. Added in 7.52.0.
3328.IP "\-\-proxy-negotiate"
3329Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating
3330with the given proxy. Use \-\-negotiate for enabling HTTP Negotiate (SPNEGO)
3331with a remote host.
3332
3333Providing --proxy-negotiate multiple times has no extra effect.
3334
3335Example:
3336.nf
3337 curl --proxy-negotiate --proxy-user user:passwd -x proxy https://example.com
3338.fi
3339
3340See also \fI--proxy-anyauth\fP and \fI--proxy-basic\fP.
3341.IP "\-\-proxy-ntlm"
3342Tells curl to use HTTP NTLM authentication when communicating with the given
3343proxy. Use \-\-ntlm for enabling NTLM with a remote host.
3344
3345Providing --proxy-ntlm multiple times has no extra effect.
3346
3347Example:
3348.nf
3349 curl --proxy-ntlm --proxy-user user:passwd -x http://proxy https://example.com
3350.fi
3351
3352See also \fI--proxy-negotiate\fP and \fI--proxy-anyauth\fP.
3353.IP "\-\-proxy-pass <phrase>"
3354Same as \-\-pass but used in HTTPS proxy context.
3355
3356If --proxy-pass is provided several times, the last set value will be used.
3357
3358Example:
3359.nf
3360 curl --proxy-pass secret --proxy-key here -x https://proxy https://example.com
3361.fi
3362
3363See also \fI-x, --proxy\fP and \fI--proxy-key\fP. Added in 7.52.0.
3364.IP "\-\-proxy-pinnedpubkey <hashes>"
3365(TLS) Tells curl to use the specified public key file (or hashes) to verify the
3366proxy. This can be a path to a file which contains a single public key in PEM
3367or DER format, or any number of base64 encoded sha256 hashes preceded by
3368\(aqsha256//' and separated by ';'.
3369
3370When negotiating a TLS or SSL connection, the server sends a certificate
3371indicating its identity. A public key is extracted from this certificate and
3372if it does not exactly match the public key provided to this option, curl will
3373abort the connection before sending or receiving any data.
3374
3375If --proxy-pinnedpubkey is provided several times, the last set value will be used.
3376
3377Examples:
3378.nf
3379 curl --proxy-pinnedpubkey keyfile https://example.com
3380 curl --proxy-pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com
3381.fi
3382
3383See also \fI--pinnedpubkey\fP and \fI-x, --proxy\fP. Added in 7.59.0.
3384.IP "\-\-proxy-service-name <name>"
3385This option allows you to change the service name for proxy negotiation.
3386
3387If --proxy-service-name is provided several times, the last set value will be used.
3388
3389Example:
3390.nf
3391 curl --proxy-service-name "shrubbery" -x proxy https://example.com
3392.fi
3393
3394See also \fI--service-name\fP and \fI-x, --proxy\fP. Added in 7.43.0.
3395.IP "\-\-proxy-ssl-allow-beast"
3396Same as \-\-ssl-allow-beast but used in HTTPS proxy context.
3397
3398Providing --proxy-ssl-allow-beast multiple times has no extra effect.
3399Disable it again with --no-proxy-ssl-allow-beast.
3400
3401Example:
3402.nf
3403 curl --proxy-ssl-allow-beast -x https://proxy https://example.com
3404.fi
3405
3406See also \fI--ssl-allow-beast\fP and \fI-x, --proxy\fP. Added in 7.52.0.
3407.IP "\-\-proxy-ssl-auto-client-cert"
3408Same as \-\-ssl-auto-client-cert but used in HTTPS proxy context.
3409
3410Providing --proxy-ssl-auto-client-cert multiple times has no extra effect.
3411Disable it again with --no-proxy-ssl-auto-client-cert.
3412
3413Example:
3414.nf
3415 curl --proxy-ssl-auto-client-cert -x https://proxy https://example.com
3416.fi
3417
3418See also \fI--ssl-auto-client-cert\fP and \fI-x, --proxy\fP. Added in 7.77.0.
3419.IP "\-\-proxy-tls13-ciphers <ciphersuite list>"
3420(TLS) Specifies which cipher suites to use in the connection to your HTTPS proxy
3421when it negotiates TLS 1.3. The list of ciphers suites must specify valid
3422ciphers. Read up on TLS 1.3 cipher suite details on this URL:
3423
3424.nf
3425 https://curl.se/docs/ssl-ciphers.html
3426.fi
3427
3428This option is currently used only when curl is built to use OpenSSL 1.1.1 or
3429later. If you are using a different SSL backend you can try setting TLS 1.3
3430cipher suites by using the \-\-proxy-ciphers option.
3431
3432If --proxy-tls13-ciphers is provided several times, the last set value will be used.
3433
3434Example:
3435.nf
3436 curl --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy https://example.com
3437.fi
3438
3439See also \fI--tls13-ciphers\fP and \fI--curves\fP. Added in 7.61.0.
3440.IP "\-\-proxy-tlsauthtype <type>"
3441Same as \-\-tlsauthtype but used in HTTPS proxy context.
3442
3443If --proxy-tlsauthtype is provided several times, the last set value will be used.
3444
3445Example:
3446.nf
3447 curl --proxy-tlsauthtype SRP -x https://proxy https://example.com
3448.fi
3449
3450See also \fI-x, --proxy\fP and \fI--proxy-tlsuser\fP. Added in 7.52.0.
3451.IP "\-\-proxy-tlspassword <string>"
3452Same as \-\-tlspassword but used in HTTPS proxy context.
3453
3454If --proxy-tlspassword is provided several times, the last set value will be used.
3455
3456Example:
3457.nf
3458 curl --proxy-tlspassword passwd -x https://proxy https://example.com
3459.fi
3460
3461See also \fI-x, --proxy\fP and \fI--proxy-tlsuser\fP. Added in 7.52.0.
3462.IP "\-\-proxy-tlsuser <name>"
3463Same as \-\-tlsuser but used in HTTPS proxy context.
3464
3465If --proxy-tlsuser is provided several times, the last set value will be used.
3466
3467Example:
3468.nf
3469 curl --proxy-tlsuser smith -x https://proxy https://example.com
3470.fi
3471
3472See also \fI-x, --proxy\fP and \fI--proxy-tlspassword\fP. Added in 7.52.0.
3473.IP "\-\-proxy-tlsv1"
3474Same as \-\-tlsv1 but used in HTTPS proxy context.
3475
3476Providing --proxy-tlsv1 multiple times has no extra effect.
3477
3478Example:
3479.nf
3480 curl --proxy-tlsv1 -x https://proxy https://example.com
3481.fi
3482
3483See also \fI-x, --proxy\fP. Added in 7.52.0.
3484.IP "\-U, \-\-proxy-user <user:password>"
3485Specify the user name and password to use for proxy authentication.
3486
3487If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM
3488authentication then you can tell curl to select the user name and password
3489from your environment by specifying a single colon with this option: "-U :".
3490
3491On systems where it works, curl will hide the given option argument from
3492process listings. This is not enough to protect credentials from possibly
3493getting seen by other users on the same system as they will still be visible
3494for a moment before cleared. Such sensitive data should be retrieved from a
3495file instead or similar and never used in clear text in a command line.
3496
3497If --proxy-user is provided several times, the last set value will be used.
3498
3499Example:
3500.nf
3501 curl --proxy-user name:pwd -x proxy https://example.com
3502.fi
3503
3504See also \fI--proxy-pass\fP.
3505.IP "\-x, \-\-proxy [protocol://]host[:port]"
3506Use the specified proxy.
3507
3508The proxy string can be specified with a protocol:// prefix. No protocol
3509specified or http:// will be treated as HTTP proxy. Use socks4://, socks4a://,
3510socks5:// or socks5h:// to request a specific SOCKS version to be used.
3511
3512
3513Unix domain sockets are supported for socks proxy. Set localhost for the host
3514part. e.g. socks5h://localhost/path/to/socket.sock
3515
3516HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for
3517OpenSSL, GnuTLS and NSS.
3518
3519Unrecognized and unsupported proxy protocols cause an error since 7.52.0.
3520Prior versions may ignore the protocol and use http:// instead.
3521
3522If the port number is not specified in the proxy string, it is assumed to be
35231080.
3524
3525This option overrides existing environment variables that set the proxy to
3526use. If there's an environment variable setting a proxy, you can set proxy to
3527\(dq" to override it.
3528
3529All operations that are performed over an HTTP proxy will transparently be
3530converted to HTTP. It means that certain protocol specific operations might
3531not be available. This is not the case if you can tunnel through the proxy, as
3532one with the \-\-proxytunnel option.
3533
3534User and password that might be provided in the proxy string are URL decoded
3535by curl. This allows you to pass in special characters such as @ by using %40
3536or pass in a colon with %3a.
3537
3538The proxy host can be specified the same way as the proxy environment
3539variables, including the protocol prefix (http://) and the embedded user +
3540password.
3541
3542If --proxy is provided several times, the last set value will be used.
3543
3544Example:
3545.nf
3546 curl --proxy http://proxy.example https://example.com
3547.fi
3548
3549See also \fI--socks5\fP and \fI--proxy-basic\fP.
3550.IP "\-\-proxy1.0 <host[:port]>"
3551Use the specified HTTP 1.0 proxy. If the port number is not specified, it is
3552assumed at port 1080.
3553
3554The only difference between this and the HTTP proxy option \fI\-x, \-\-proxy\fP, is that
3555attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol
3556instead of the default HTTP 1.1.
3557
3558Providing --proxy1.0 multiple times has no extra effect.
3559
3560Example:
3561.nf
3562 curl --proxy1.0 -x http://proxy https://example.com
3563.fi
3564
3565See also \fI-x, --proxy\fP, \fI--socks5\fP and \fI--preproxy\fP.
3566.IP "\-p, \-\-proxytunnel"
3567When an HTTP proxy is used \fI\-x, \-\-proxy\fP, this option will make curl tunnel through
3568the proxy. The tunnel approach is made with the HTTP proxy CONNECT request and
3569requires that the proxy allows direct connect to the remote port number curl
3570wants to tunnel through to.
3571
3572To suppress proxy CONNECT response headers when curl is set to output headers
3573use \fI\-\-suppress-connect-headers\fP.
3574
3575Providing --proxytunnel multiple times has no extra effect.
3576Disable it again with --no-proxytunnel.
3577
3578Example:
3579.nf
3580 curl --proxytunnel -x http://proxy https://example.com
3581.fi
3582
3583See also \fI-x, --proxy\fP.
3584.IP "\-\-pubkey <key>"
3585(SFTP SCP) Public key file name. Allows you to provide your public key in this separate
3586file.
3587
3588(As of 7.39.0, curl attempts to automatically extract the public key from the
3589private key file, so passing this option is generally not required. Note that
3590this public key extraction requires libcurl to be linked against a copy of
3591libssh2 1.2.8 or higher that is itself linked against OpenSSL.)
3592
3593If --pubkey is provided several times, the last set value will be used.
3594
3595Example:
3596.nf
3597 curl --pubkey file.pub sftp://example.com/
3598.fi
3599
3600See also \fI--pass\fP.
3601.IP "\-Q, \-\-quote <command>"
3602(FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are
3603sent BEFORE the transfer takes place (just after the initial PWD command in an
3604FTP transfer, to be exact). To make commands take place after a successful
3605transfer, prefix them with a dash '-'.
3606
3607(FTP only) To make commands be sent after curl has changed the working
3608directory, just before the file transfer command(s), prefix the command with a
3609\(aq+'. This is not performed when a directory listing is performed.
3610
3611You may specify any number of commands.
3612
3613By default curl will stop at first failure. To make curl continue even if the
3614command fails, prefix the command with an asterisk (*). Otherwise, if the
3615server returns failure for one of the commands, the entire operation will be
3616aborted.
3617
3618You must send syntactically correct FTP commands as RFC 959 defines to FTP
3619servers, or one of the commands listed below to SFTP servers.
3620
3621This option can be used multiple times.
3622
3623SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
3624itself before sending them to the server. File names may be quoted
3625shell-style to embed spaces or special characters. Following is the list of
3626all supported SFTP quote commands:
3627.RS
3628.IP "atime date file"
3629The atime command sets the last access time of the file named by the file
3630operand. The <date expression> can be all sorts of date strings, see the
3631\fIcurl_getdate(3)\fP man page for date expression details. (Added in 7.73.0)
3632.IP "chgrp group file"
3633The chgrp command sets the group ID of the file named by the file operand to
3634the group ID specified by the group operand. The group operand is a decimal
3635integer group ID.
3636.IP "chmod mode file"
3637The chmod command modifies the file mode bits of the specified file. The
3638mode operand is an octal integer mode number.
3639.IP "chown user file"
3640The chown command sets the owner of the file named by the file operand to the
3641user ID specified by the user operand. The user operand is a decimal
3642integer user ID.
3643.IP "ln source_file target_file"
3644The ln and symlink commands create a symbolic link at the target_file location
3645pointing to the source_file location.
3646.IP "mkdir directory_name"
3647The mkdir command creates the directory named by the directory_name operand.
3648.IP "mtime date file"
3649The mtime command sets the last modification time of the file named by the
3650file operand. The <date expression> can be all sorts of date strings, see the
3651\fIcurl_getdate(3)\fP man page for date expression details. (Added in 7.73.0)
3652.IP "pwd"
3653The pwd command returns the absolute pathname of the current working directory.
3654.IP "rename source target"
3655The rename command renames the file or directory named by the source
3656operand to the destination path named by the target operand.
3657.IP "rm file"
3658The rm command removes the file specified by the file operand.
3659.IP "rmdir directory"
3660The rmdir command removes the directory entry specified by the directory
3661operand, provided it is empty.
3662.IP "symlink source_file target_file"
3663See ln.
3664.RE
3665
3666--quote can be used several times in a command line
3667
3668Example:
3669.nf
3670 curl --quote "DELE file" ftp://example.com/foo
3671.fi
3672
3673See also \fI-X, --request\fP.
3674.IP "\-\-random-file <file>"
3675Deprecated option. This option is ignored by curl since 7.84.0. Prior to that
3676it only had an effect on curl if built to use old versions of OpenSSL.
3677
3678Specify the path name to file containing what will be considered as random
3679data. The data may be used to seed the random engine for SSL connections.
3680
3681If --random-file is provided several times, the last set value will be used.
3682
3683Example:
3684.nf
3685 curl --random-file rubbish https://example.com
3686.fi
3687
3688See also \fI--egd-file\fP.
3689.IP "\-r, \-\-range <range>"
3690(HTTP FTP SFTP FILE) Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP
3691server or a local FILE. Ranges can be specified in a number of ways.
3692.RS
3693.TP 10
3694.B 0-499
3695specifies the first 500 bytes
3696.TP
3697.B 500-999
3698specifies the second 500 bytes
3699.TP
3700.B \-500
3701specifies the last 500 bytes
3702.TP
3703.B 9500-
3704specifies the bytes from offset 9500 and forward
3705.TP
3706.B 0-0,-1
3707specifies the first and last byte only(*)(HTTP)
3708.TP
3709.B 100-199,500-599
3710specifies two separate 100-byte ranges(*) (HTTP)
3711.RE
3712.IP
3713(*) = NOTE that this will cause the server to reply with a multipart
3714response, which will be returned as-is by curl! Parsing or otherwise
3715transforming this response is the responsibility of the caller.
3716
3717Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
3718\(aqstart-stop' range syntax. If a non-digit character is given in the range,
3719the server's response will be unspecified, depending on the server's
3720configuration.
3721
3722You should also be aware that many HTTP/1.1 servers do not have this feature
3723enabled, so that when you attempt to get a range, you will instead get the
3724whole document.
3725
3726FTP and SFTP range downloads only support the simple 'start-stop' syntax
3727(optionally with one of the numbers omitted). FTP use depends on the extended
3728FTP command SIZE.
3729
3730If --range is provided several times, the last set value will be used.
3731
3732Example:
3733.nf
3734 curl --range 22-44 https://example.com
3735.fi
3736
3737See also \fI-C, --continue-at\fP and \fI-a, --append\fP.
3738.IP "\-\-rate <max request rate>"
3739Specify the maximum transfer frequency you allow curl to use \- in number of
3740transfer starts per time unit (sometimes called request rate). Without this
3741option, curl will start the next transfer as fast as possible.
3742
3743If given several URLs and a transfer completes faster than the allowed rate,
3744curl will wait until the next transfer is started to maintain the requested
3745rate. This option has no effect when \-\-parallel is used.
3746
3747The request rate is provided as "N/U" where N is an integer number and U is a
3748time unit. Supported units are 's' (second), 'm' (minute), 'h' (hour) and 'd'
3749/(day, as in a 24 hour unit). The default time unit, if no "/U" is provided,
3750is number of transfers per hour.
3751
3752If curl is told to allow 10 requests per minute, it will not start the next
3753request until 6 seconds have elapsed since the previous transfer was started.
3754
3755This function uses millisecond resolution. If the allowed frequency is set
3756more than 1000 per second, it will instead run unrestricted.
3757
3758When retrying transfers, enabled with \fI\-\-retry\fP, the separate retry delay logic
3759is used and not this setting.
3760
3761If --rate is provided several times, the last set value will be used.
3762
3763Examples:
3764.nf
3765 curl --rate 2/s https://example.com
3766 curl --rate 3/h https://example.com
3767 curl --rate 14/m https://example.com
3768.fi
3769
3770See also \fI--limit-rate\fP and \fI--retry-delay\fP. Added in 7.84.0.
3771.IP "\-\-raw"
3772(HTTP) When used, it disables all internal HTTP decoding of content or transfer
3773encodings and instead makes them passed on unaltered, raw.
3774
3775Providing --raw multiple times has no extra effect.
3776Disable it again with --no-raw.
3777
3778Example:
3779.nf
3780 curl --raw https://example.com
3781.fi
3782
3783See also \fI--tr-encoding\fP.
3784.IP "\-e, \-\-referer <URL>"
3785(HTTP) Sends the "Referrer Page" information to the HTTP server. This can also be set
3786with the \-\-header flag of course. When used with \-\-location you can append
3787\(dq;auto" to the \-\-referer URL to make curl automatically set the previous URL
3788when it follows a Location: header. The ";auto" string can be used alone,
3789even if you do not set an initial \fI\-e, \-\-referer\fP.
3790
3791If --referer is provided several times, the last set value will be used.
3792
3793Examples:
3794.nf
3795 curl --referer "https://fake.example" https://example.com
3796 curl --referer "https://fake.example;auto" -L https://example.com
3797 curl --referer ";auto" -L https://example.com
3798.fi
3799
3800See also \fI-A, --user-agent\fP and \fI-H, --header\fP.
3801.IP "\-J, \-\-remote-header-name"
3802(HTTP) This option tells the \-\-remote-name option to use the server-specified
3803Content-Disposition filename instead of extracting a filename from the URL. If
3804the server-provided file name contains a path, that will be stripped off
3805before the file name is used.
3806
3807The file is saved in the current directory, or in the directory specified with
3808\fI\-\-output-dir\fP.
3809
3810If the server specifies a file name and a file with that name already exists
3811in the destination directory, it will not be overwritten and an error will
3812occur. If the server does not specify a file name then this option has no
3813effect.
3814
3815There's no attempt to decode %-sequences (yet) in the provided file name, so
3816this option may provide you with rather unexpected file names.
3817
3818\fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
3819rogue server could send you the name of a DLL or other file that could be
3820loaded automatically by Windows or some third party software.
3821
3822Providing --remote-header-name multiple times has no extra effect.
3823Disable it again with --no-remote-header-name.
3824
3825Example:
3826.nf
3827 curl -OJ https://example.com/file
3828.fi
3829
3830See also \fI-O, --remote-name\fP.
3831.IP "\-\-remote-name-all"
3832This option changes the default action for all given URLs to be dealt with as
3833if \-\-remote-name were used for each one. So if you want to disable that for a
3834specific URL after \-\-remote-name-all has been used, you must use "-o \-" or
3835\-\-no-remote-name.
3836
3837Providing --remote-name-all multiple times has no extra effect.
3838Disable it again with --no-remote-name-all.
3839
3840Example:
3841.nf
3842 curl --remote-name-all ftp://example.com/file1 ftp://example.com/file2
3843.fi
3844
3845See also \fI-O, --remote-name\fP.
3846.IP "\-O, \-\-remote-name"
3847Write output to a local file named like the remote file we get. (Only the file
3848part of the remote file is used, the path is cut off.)
3849
3850The file will be saved in the current working directory. If you want the file
3851saved in a different directory, make sure you change the current working
3852directory before invoking curl with this option or use \fI\-\-output-dir\fP.
3853
3854The remote file name to use for saving is extracted from the given URL,
3855nothing else, and if it already exists it will be overwritten. If you want the
3856server to be able to choose the file name refer to \-\-remote-header-name which
3857can be used in addition to this option. If the server chooses a file name and
3858that name already exists it will not be overwritten.
3859
3860There is no URL decoding done on the file name. If it has %20 or other URL
3861encoded parts of the name, they will end up as-is as file name.
3862
3863You may use this option as many times as the number of URLs you have.
3864
3865--remote-name can be used several times in a command line
3866
3867Example:
3868.nf
3869 curl -O https://example.com/filename
3870.fi
3871
3872See also \fI--remote-name-all\fP, \fI--output-dir\fP and \fI-J, --remote-header-name\fP.
3873.IP "\-R, \-\-remote-time"
3874When used, this will make curl attempt to figure out the timestamp of the
3875remote file, and if that is available make the local file get that same
3876timestamp.
3877
3878Providing --remote-time multiple times has no extra effect.
3879Disable it again with --no-remote-time.
3880
3881Example:
3882.nf
3883 curl --remote-time -o foo https://example.com
3884.fi
3885
3886See also \fI-O, --remote-name\fP and \fI-z, --time-cond\fP.
3887.IP "\-\-remove-on-error"
3888When curl returns an error when told to save output in a local file, this
3889option removes that saved file before exiting. This prevents curl from
3890leaving a partial file in the case of an error during transfer.
3891
3892If the output is not a file, this option has no effect.
3893
3894Providing --remove-on-error multiple times has no extra effect.
3895Disable it again with --no-remove-on-error.
3896
3897Example:
3898.nf
3899 curl --remove-on-error -o output https://example.com
3900.fi
3901
3902See also \fI-f, --fail\fP. Added in 7.83.0.
3903.IP "\-\-request-target <path>"
3904(HTTP) Tells curl to use an alternative "target" (path) instead of using the path as
3905provided in the URL. Particularly useful when wanting to issue HTTP requests
3906without leading slash or other data that does not follow the regular URL
3907pattern, like "OPTIONS *".
3908
3909If --request-target is provided several times, the last set value will be used.
3910
3911Example:
3912.nf
3913 curl --request-target "*" -X OPTIONS https://example.com
3914.fi
3915
3916See also \fI-X, --request\fP. Added in 7.55.0.
3917.IP "\-X, \-\-request <method>"
3918(HTTP) Specifies a custom request method to use when communicating with the
3919HTTP server. The specified request method will be used instead of the method
3920otherwise used (which defaults to GET). Read the HTTP 1.1 specification for
3921details and explanations. Common additional HTTP requests include PUT and
3922DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
3923more.
3924
3925Normally you do not need this option. All sorts of GET, HEAD, POST and PUT
3926requests are rather invoked by using dedicated command line options.
3927
3928This option only changes the actual word used in the HTTP request, it does not
3929alter the way curl behaves. So for example if you want to make a proper HEAD
3930request, using \-X HEAD will not suffice. You need to use the \-\-head option.
3931
3932The method string you set with \-\-request will be used for all requests, which
3933if you for example use \-\-location may cause unintended side-effects when curl
3934does not change request method according to the HTTP 30x response codes \- and
3935similar.
3936
3937(FTP)
3938Specifies a custom FTP command to use instead of LIST when doing file lists
3939with FTP.
3940
3941(POP3)
3942Specifies a custom POP3 command to use instead of LIST or RETR.
3943
3944
3945(IMAP)
3946Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0)
3947
3948(SMTP)
3949Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)
3950
3951If --request is provided several times, the last set value will be used.
3952
3953Examples:
3954.nf
3955 curl -X "DELETE" https://example.com
3956 curl -X NLST ftp://example.com/
3957.fi
3958
3959See also \fI--request-target\fP.
3960.IP "\-\-resolve <[+]host:port:addr[,addr]...>"
3961Provide a custom address for a specific host and port pair. Using this, you
3962can make the curl requests(s) use a specified address and prevent the
3963otherwise normally resolved address to be used. Consider it a sort of
3964/etc/hosts alternative provided on the command line. The port number should be
3965the number used for the specific protocol the host will be used for. It means
3966you need several entries if you want to provide address for the same host but
3967different ports.
3968
3969By specifying '*' as host you can tell curl to resolve any host and specific
3970port pair to the specified address. Wildcard is resolved last so any \-\-resolve
3971with a specific host and port will be used first.
3972
3973The provided address set by this option will be used even if \-\-ipv4 or \-\-ipv6
3974is set to make curl use another IP version.
3975
3976By prefixing the host with a '+' you can make the entry time out after curl's
3977default timeout (1 minute). Note that this will only make sense for long
3978running parallel transfers with a lot of files. In such cases, if this option
3979is used curl will try to resolve the host as it normally would once the
3980timeout has expired.
3981
3982Support for providing the IP address within [brackets] was added in 7.57.0.
3983
3984Support for providing multiple IP addresses per entry was added in 7.59.0.
3985
3986Support for resolving with wildcard was added in 7.64.0.
3987
3988Support for the '+' prefix was was added in 7.75.0.
3989
3990This option can be used many times to add many host names to resolve.
3991
3992--resolve can be used several times in a command line
3993
3994Example:
3995.nf
3996 curl --resolve example.com:443:127.0.0.1 https://example.com
3997.fi
3998
3999See also \fI--connect-to\fP and \fI--alt-svc\fP.
4000.IP "\-\-retry-all-errors"
4001Retry on any error. This option is used together with \fI\-\-retry\fP.
4002
4003This option is the "sledgehammer" of retrying. Do not use this option by
4004default (eg in curlrc), there may be unintended consequences such as sending or
4005receiving duplicate data. Do not use with redirected input or output. You'd be
4006much better off handling your unique problems in shell script. Please read the
4007example below.
4008
4009\fBWARNING\fP: For server compatibility curl attempts to retry failed flaky
4010transfers as close as possible to how they were started, but this is not
4011possible with redirected input or output. For example, before retrying it
4012removes output data from a failed partial transfer that was written to an
4013output file. However this is not true of data redirected to a | pipe or >
4014file, which are not reset. We strongly suggest you do not parse or record
4015output via redirect in combination with this option, since you may receive
4016duplicate data.
4017
4018By default curl will not error on an HTTP response code that indicates an HTTP
4019error, if the transfer was successful. For example, if a server replies 404
4020Not Found and the reply is fully received then that is not an error. When
4021\-\-retry is used then curl will retry on some HTTP response codes that indicate
4022transient HTTP errors, but that does not include most 4xx response codes such
4023as 404. If you want to retry on all response codes that indicate HTTP errors
4024(4xx and 5xx) then combine with \fI\-f, \-\-fail\fP.
4025
4026Providing --retry-all-errors multiple times has no extra effect.
4027Disable it again with --no-retry-all-errors.
4028
4029Example:
4030.nf
4031 curl --retry 5 --retry-all-errors https://example.com
4032.fi
4033
4034See also \fI--retry\fP. Added in 7.71.0.
4035.IP "\-\-retry-connrefused"
4036In addition to the other conditions, consider ECONNREFUSED as a transient
4037error too for \fI\-\-retry\fP. This option is used together with \-\-retry.
4038
4039Providing --retry-connrefused multiple times has no extra effect.
4040Disable it again with --no-retry-connrefused.
4041
4042Example:
4043.nf
4044 curl --retry-connrefused --retry https://example.com
4045.fi
4046
4047See also \fI--retry\fP and \fI--retry-all-errors\fP. Added in 7.52.0.
4048.IP "\-\-retry-delay <seconds>"
4049Make curl sleep this amount of time before each retry when a transfer has
4050failed with a transient error (it changes the default backoff time algorithm
4051between retries). This option is only interesting if \-\-retry is also
4052used. Setting this delay to zero will make curl use the default backoff time.
4053
4054If --retry-delay is provided several times, the last set value will be used.
4055
4056Example:
4057.nf
4058 curl --retry-delay 5 --retry https://example.com
4059.fi
4060
4061See also \fI--retry\fP.
4062.IP "\-\-retry-max-time <seconds>"
4063The retry timer is reset before the first transfer attempt. Retries will be
4064done as usual (see \fI\-\-retry\fP) as long as the timer has not reached this given
4065limit. Notice that if the timer has not reached the limit, the request will be
4066made and while performing, it may take longer than this given time period. To
4067limit a single request's maximum time, use \fI\-m, \-\-max-time\fP. Set this option to
4068zero to not timeout retries.
4069
4070If --retry-max-time is provided several times, the last set value will be used.
4071
4072Example:
4073.nf
4074 curl --retry-max-time 30 --retry 10 https://example.com
4075.fi
4076
4077See also \fI--retry\fP.
4078.IP "\-\-retry <num>"
4079If a transient error is returned when curl tries to perform a transfer, it
4080will retry this number of times before giving up. Setting the number to 0
4081makes curl do no retries (which is the default). Transient error means either:
4082a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504
4083response code.
4084
4085When curl is about to retry a transfer, it will first wait one second and then
4086for all forthcoming retries it will double the waiting time until it reaches
408710 minutes which then will be the delay between the rest of the retries. By
4088using \-\-retry-delay you disable this exponential backoff algorithm. See also
4089\-\-retry-max-time to limit the total time allowed for retries.
4090
4091Since curl 7.66.0, curl will comply with the Retry-After: response header if
4092one was present to know when to issue the next retry.
4093
4094If --retry is provided several times, the last set value will be used.
4095
4096Example:
4097.nf
4098 curl --retry 7 https://example.com
4099.fi
4100
4101See also \fI--retry-max-time\fP.
4102.IP "\-\-sasl-authzid <identity>"
4103Use this authorization identity (authzid), during SASL PLAIN authentication,
4104in addition to the authentication identity (authcid) as specified by \fI\-u, \-\-user\fP.
4105
4106If the option is not specified, the server will derive the authzid from the
4107authcid, but if specified, and depending on the server implementation, it may
4108be used to access another user's inbox, that the user has been granted access
4109to, or a shared mailbox for example.
4110
4111If --sasl-authzid is provided several times, the last set value will be used.
4112
4113Example:
4114.nf
4115 curl --sasl-authzid zid imap://example.com/
4116.fi
4117
4118See also \fI--login-options\fP. Added in 7.66.0.
4119.IP "\-\-sasl-ir"
4120Enable initial response in SASL authentication.
4121
4122Providing --sasl-ir multiple times has no extra effect.
4123Disable it again with --no-sasl-ir.
4124
4125Example:
4126.nf
4127 curl --sasl-ir imap://example.com/
4128.fi
4129
4130See also \fI--sasl-authzid\fP. Added in 7.31.0.
4131.IP "\-\-service-name <name>"
4132This option allows you to change the service name for SPNEGO.
4133
4134Examples: \fI\-\-negotiate\fP \-\-service-name sockd would use sockd/server-name.
4135
4136If --service-name is provided several times, the last set value will be used.
4137
4138Example:
4139.nf
4140 curl --service-name sockd/server https://example.com
4141.fi
4142
4143See also \fI--negotiate\fP and \fI--proxy-service-name\fP. Added in 7.43.0.
4144.IP "\-S, \-\-show-error"
4145When used with \fI\-s, \-\-silent\fP, it makes curl show an error message if it fails.
4146
4147This option is global and does not need to be specified for each use of
4148\fI\-:, \-\-next\fP.
4149
4150Providing --show-error multiple times has no extra effect.
4151Disable it again with --no-show-error.
4152
4153Example:
4154.nf
4155 curl --show-error --silent https://example.com
4156.fi
4157
4158See also \fI--no-progress-meter\fP.
4159.IP "\-s, \-\-silent"
4160Silent or quiet mode. Do not show progress meter or error messages. Makes Curl
4161mute. It will still output the data you ask for, potentially even to the
4162terminal/stdout unless you redirect it.
4163
4164Use \-\-show-error in addition to this option to disable progress meter but
4165still show error messages.
4166
4167Providing --silent multiple times has no extra effect.
4168Disable it again with --no-silent.
4169
4170Example:
4171.nf
4172 curl -s https://example.com
4173.fi
4174
4175See also \fI-v, --verbose\fP, \fI--stderr\fP and \fI--no-progress-meter\fP.
4176.IP "\-\-socks4 <host[:port]>"
4177Use the specified SOCKS4 proxy. If the port number is not specified, it is
4178assumed at port 1080. Using this socket type make curl resolve the host name
4179and passing the address on to the proxy.
4180
4181To specify proxy on a unix domain socket, use localhost for host, e.g.
4182socks4://localhost/path/to/socket.sock
4183
4184This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
4185exclusive.
4186
4187This option is superfluous since you can specify a socks4 proxy with \-\-proxy
4188using a socks4:// protocol prefix.
4189
4190Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time
4191\-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to
4192the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
4193
4194If --socks4 is provided several times, the last set value will be used.
4195
4196Example:
4197.nf
4198 curl --socks4 hostname:4096 https://example.com
4199.fi
4200
4201See also \fI--socks4a\fP, \fI--socks5\fP and \fI--socks5-hostname\fP.
4202.IP "\-\-socks4a <host[:port]>"
4203Use the specified SOCKS4a proxy. If the port number is not specified, it is
4204assumed at port 1080. This asks the proxy to resolve the host name.
4205
4206To specify proxy on a unix domain socket, use localhost for host, e.g.
4207socks4a://localhost/path/to/socket.sock
4208
4209This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
4210exclusive.
4211
4212This option is superfluous since you can specify a socks4a proxy with \-\-proxy
4213using a socks4a:// protocol prefix.
4214
4215Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time
4216\-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to
4217the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
4218
4219If --socks4a is provided several times, the last set value will be used.
4220
4221Example:
4222.nf
4223 curl --socks4a hostname:4096 https://example.com
4224.fi
4225
4226See also \fI--socks4\fP, \fI--socks5\fP and \fI--socks5-hostname\fP.
4227.IP "\-\-socks5-basic"
4228Tells curl to use username/password authentication when connecting to a SOCKS5
4229proxy. The username/password authentication is enabled by default. Use
4230\-\-socks5-gssapi to force GSS-API authentication to SOCKS5 proxies.
4231
4232Providing --socks5-basic multiple times has no extra effect.
4233
4234Example:
4235.nf
4236 curl --socks5-basic --socks5 hostname:4096 https://example.com
4237.fi
4238
4239See also \fI--socks5\fP. Added in 7.55.0.
4240.IP "\-\-socks5-gssapi-nec"
4241As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961
4242says in section 4.3/4.4 it should be protected, but the NEC reference
4243implementation does not. The option \-\-socks5-gssapi-nec allows the
4244unprotected exchange of the protection mode negotiation.
4245
4246Providing --socks5-gssapi-nec multiple times has no extra effect.
4247Disable it again with --no-socks5-gssapi-nec.
4248
4249Example:
4250.nf
4251 curl --socks5-gssapi-nec --socks5 hostname:4096 https://example.com
4252.fi
4253
4254See also \fI--socks5\fP.
4255.IP "\-\-socks5-gssapi-service <name>"
4256The default service name for a socks server is rcmd/server-fqdn. This option
4257allows you to change it.
4258
4259Examples: \-\-socks5 proxy-name \-\-socks5-gssapi-service sockd would use
4260sockd/proxy-name \-\-socks5 proxy-name \-\-socks5-gssapi-service sockd/real-name
4261would use sockd/real-name for cases where the proxy-name does not match the
4262principal name.
4263
4264If --socks5-gssapi-service is provided several times, the last set value will be used.
4265
4266Example:
4267.nf
4268 curl --socks5-gssapi-service sockd --socks5 hostname:4096 https://example.com
4269.fi
4270
4271See also \fI--socks5\fP.
4272.IP "\-\-socks5-gssapi"
4273Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy.
4274The GSS-API authentication is enabled by default (if curl is compiled with
4275GSS-API support). Use \-\-socks5-basic to force username/password authentication
4276to SOCKS5 proxies.
4277
4278Providing --socks5-gssapi multiple times has no extra effect.
4279Disable it again with --no-socks5-gssapi.
4280
4281Example:
4282.nf
4283 curl --socks5-gssapi --socks5 hostname:4096 https://example.com
4284.fi
4285
4286See also \fI--socks5\fP. Added in 7.55.0.
4287.IP "\-\-socks5-hostname <host[:port]>"
4288Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If
4289the port number is not specified, it is assumed at port 1080.
4290
4291To specify proxy on a unix domain socket, use localhost for host, e.g.
4292socks5h://localhost/path/to/socket.sock
4293
4294This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
4295exclusive.
4296
4297This option is superfluous since you can specify a socks5 hostname proxy with
4298\-\-proxy using a socks5h:// protocol prefix.
4299
4300Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time
4301\-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to
4302the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
4303
4304If --socks5-hostname is provided several times, the last set value will be used.
4305
4306Example:
4307.nf
4308 curl --socks5-hostname proxy.example:7000 https://example.com
4309.fi
4310
4311See also \fI--socks5\fP and \fI--socks4a\fP.
4312.IP "\-\-socks5 <host[:port]>"
4313Use the specified SOCKS5 proxy \- but resolve the host name locally. If the
4314port number is not specified, it is assumed at port 1080.
4315
4316To specify proxy on a unix domain socket, use localhost for host, e.g.
4317socks5://localhost/path/to/socket.sock
4318
4319This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
4320exclusive.
4321
4322This option is superfluous since you can specify a socks5 proxy with \-\-proxy
4323using a socks5:// protocol prefix.
4324
4325Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time
4326\-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to
4327the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
4328
4329This option (as well as \fI\-\-socks4\fP) does not work with IPV6, FTPS or LDAP.
4330
4331If --socks5 is provided several times, the last set value will be used.
4332
4333Example:
4334.nf
4335 curl --socks5 proxy.example:7000 https://example.com
4336.fi
4337
4338See also \fI--socks5-hostname\fP and \fI--socks4a\fP.
4339.IP "\-Y, \-\-speed-limit <speed>"
4340If a transfer is slower than this given speed (in bytes per second) for
4341speed-time seconds it gets aborted. speed-time is set with \-\-speed-time and is
434230 if not set.
4343
4344If --speed-limit is provided several times, the last set value will be used.
4345
4346Example:
4347.nf
4348 curl --speed-limit 300 --speed-time 10 https://example.com
4349.fi
4350
4351See also \fI-y, --speed-time\fP, \fI--limit-rate\fP and \fI-m, --max-time\fP.
4352.IP "\-y, \-\-speed-time <seconds>"
4353If a transfer runs slower than speed-limit bytes per second during a speed-time
4354period, the transfer is aborted. If speed-time is used, the default
4355speed-limit will be 1 unless set with \fI\-Y, \-\-speed-limit\fP.
4356
4357This option controls transfers (in both directions) but will not affect slow
4358connects etc. If this is a concern for you, try the \-\-connect-timeout option.
4359
4360If --speed-time is provided several times, the last set value will be used.
4361
4362Example:
4363.nf
4364 curl --speed-limit 300 --speed-time 10 https://example.com
4365.fi
4366
4367See also \fI-Y, --speed-limit\fP and \fI--limit-rate\fP.
4368.IP "\-\-ssl-allow-beast"
4369This option tells curl to not work around a security flaw in the SSL3 and
4370TLS1.0 protocols known as BEAST. If this option is not used, the SSL layer
4371may use workarounds known to cause interoperability problems with some older
4372SSL implementations.
4373
4374\fBWARNING\fP: this option loosens the SSL security, and by using this flag you
4375ask for exactly that.
4376
4377Providing --ssl-allow-beast multiple times has no extra effect.
4378Disable it again with --no-ssl-allow-beast.
4379
4380Example:
4381.nf
4382 curl --ssl-allow-beast https://example.com
4383.fi
4384
4385See also \fI--proxy-ssl-allow-beast\fP and \fI-k, --insecure\fP.
4386.IP "\-\-ssl-auto-client-cert"
4387Tell libcurl to automatically locate and use a client certificate for
4388authentication, when requested by the server. This option is only supported
4389for Schannel (the native Windows SSL library). Prior to 7.77.0 this was the
4390default behavior in libcurl with Schannel. Since the server can request any
4391certificate that supports client authentication in the OS certificate store it
4392could be a privacy violation and unexpected.
4393
4394Providing --ssl-auto-client-cert multiple times has no extra effect.
4395Disable it again with --no-ssl-auto-client-cert.
4396
4397Example:
4398.nf
4399 curl --ssl-auto-client-cert https://example.com
4400.fi
4401
4402See also \fI--proxy-ssl-auto-client-cert\fP. Added in 7.77.0.
4403.IP "\-\-ssl-no-revoke"
4404(Schannel) This option tells curl to disable certificate revocation checks.
4405WARNING: this option loosens the SSL security, and by using this flag you ask
4406for exactly that.
4407
4408Providing --ssl-no-revoke multiple times has no extra effect.
4409Disable it again with --no-ssl-no-revoke.
4410
4411Example:
4412.nf
4413 curl --ssl-no-revoke https://example.com
4414.fi
4415
4416See also \fI--crlfile\fP. Added in 7.44.0.
4417.IP "\-\-ssl-reqd"
4418(FTP IMAP POP3 SMTP LDAP) Require SSL/TLS for the connection. Terminates the connection if the server
4419does not support SSL/TLS.
4420
4421This option is handled in LDAP since version 7.81.0. It is fully supported
4422by the OpenLDAP backend and rejected by the generic ldap backend if explicit
4423TLS is required.
4424
4425This option was formerly known as \-\-ftp-ssl-reqd.
4426
4427Providing --ssl-reqd multiple times has no extra effect.
4428Disable it again with --no-ssl-reqd.
4429
4430Example:
4431.nf
4432 curl --ssl-reqd ftp://example.com
4433.fi
4434
4435See also \fI--ssl\fP and \fI-k, --insecure\fP.
4436.IP "\-\-ssl-revoke-best-effort"
4437(Schannel) This option tells curl to ignore certificate revocation checks when
4438they failed due to missing/offline distribution points for the revocation check
4439lists.
4440
4441Providing --ssl-revoke-best-effort multiple times has no extra effect.
4442Disable it again with --no-ssl-revoke-best-effort.
4443
4444Example:
4445.nf
4446 curl --ssl-revoke-best-effort https://example.com
4447.fi
4448
4449See also \fI--crlfile\fP and \fI-k, --insecure\fP. Added in 7.70.0.
4450.IP "\-\-ssl"
4451(FTP IMAP POP3 SMTP LDAP) Warning: this is considered an insecure option. Consider using \-\-ssl-reqd
4452instead to be sure curl upgrades to a secure connection.
4453
4454Try to use SSL/TLS for the connection. Reverts to a non-secure connection if
4455the server does not support SSL/TLS. See also \-\-ftp-ssl-control and \-\-ssl-reqd
4456for different levels of encryption required.
4457
4458This option is handled in LDAP since version 7.81.0. It is fully supported
4459by the OpenLDAP backend and ignored by the generic ldap backend.
4460
4461Please note that a server may close the connection if the negotiation does
4462not succeed.
4463
4464This option was formerly known as \-\-ftp-ssl. That option
4465name can still be used but will be removed in a future version.
4466
4467Providing --ssl multiple times has no extra effect.
4468Disable it again with --no-ssl.
4469
4470Example:
4471.nf
4472 curl --ssl pop3://example.com/
4473.fi
4474
4475See also \fI--ssl-reqd\fP, \fI-k, --insecure\fP and \fI--ciphers\fP.
4476.IP "\-2, \-\-sslv2"
4477(SSL) This option previously asked curl to use SSLv2, but starting in curl 7.77.0
4478this instruction is ignored. SSLv2 is widely considered insecure (see RFC
44796176).
4480
4481Providing --sslv2 multiple times has no extra effect.
4482
4483Example:
4484.nf
4485 curl --sslv2 https://example.com
4486.fi
4487
4488See 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 is mutually exclusive to \fI-3, --sslv3\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP.
4489.IP "\-3, \-\-sslv3"
4490(SSL) This option previously asked curl to use SSLv3, but starting in curl 7.77.0
4491this instruction is ignored. SSLv3 is widely considered insecure (see RFC
44927568).
4493
4494Providing --sslv3 multiple times has no extra effect.
4495
4496Example:
4497.nf
4498 curl --sslv3 https://example.com
4499.fi
4500
4501See 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 is mutually exclusive to \fI-2, --sslv2\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP.
4502.IP "\-\-stderr <file>"
4503Redirect all writes to stderr to the specified file instead. If the file name
4504is a plain '-', it is instead written to stdout.
4505
4506This option is global and does not need to be specified for each use of
4507\fI\-:, \-\-next\fP.
4508
4509If --stderr is provided several times, the last set value will be used.
4510
4511Example:
4512.nf
4513 curl --stderr output.txt https://example.com
4514.fi
4515
4516See also \fI-v, --verbose\fP and \fI-s, --silent\fP.
4517.IP "\-\-styled-output"
4518Enables the automatic use of bold font styles when writing HTTP headers to the
4519terminal. Use \-\-no-styled-output to switch them off.
4520
4521This option is global and does not need to be specified for each use of
4522\fI\-:, \-\-next\fP.
4523
4524Providing --styled-output multiple times has no extra effect.
4525Disable it again with --no-styled-output.
4526
4527Example:
4528.nf
4529 curl --styled-output -I https://example.com
4530.fi
4531
4532See also \fI-I, --head\fP and \fI-v, --verbose\fP. Added in 7.61.0.
4533.IP "\-\-suppress-connect-headers"
4534When \-\-proxytunnel is used and a CONNECT request is made do not output proxy
4535CONNECT response headers. This option is meant to be used with \-\-dump-header or
4536\-\-include which are used to show protocol headers in the output. It has no
4537effect on debug options such as \-\-verbose or \fI\-\-trace\fP, or any statistics.
4538
4539Providing --suppress-connect-headers multiple times has no extra effect.
4540Disable it again with --no-suppress-connect-headers.
4541
4542Example:
4543.nf
4544 curl --suppress-connect-headers --include -x proxy https://example.com
4545.fi
4546
4547See also \fI-D, --dump-header\fP, \fI-i, --include\fP and \fI-p, --proxytunnel\fP. Added in 7.54.0.
4548.IP "\-\-tcp-fastopen"
4549Enable use of TCP Fast Open (RFC7413).
4550
4551Providing --tcp-fastopen multiple times has no extra effect.
4552Disable it again with --no-tcp-fastopen.
4553
4554Example:
4555.nf
4556 curl --tcp-fastopen https://example.com
4557.fi
4558
4559See also \fI--false-start\fP. Added in 7.49.0.
4560.IP "\-\-tcp-nodelay"
4561Turn on the TCP_NODELAY option. See the \fIcurl_easy_setopt(3)\fP man page for
4562details about this option.
4563
4564Since 7.50.2, curl sets this option by default and you need to explicitly
4565switch it off if you do not want it on.
4566
4567Providing --tcp-nodelay multiple times has no extra effect.
4568Disable it again with --no-tcp-nodelay.
4569
4570Example:
4571.nf
4572 curl --tcp-nodelay https://example.com
4573.fi
4574
4575See also \fI-N, --no-buffer\fP.
4576.IP "\-t, \-\-telnet-option <opt=val>"
4577Pass options to the telnet protocol. Supported options are:
4578
4579TTYPE=<term> Sets the terminal type.
4580
4581XDISPLOC=<X display> Sets the X display location.
4582
4583NEW_ENV=<var,val> Sets an environment variable.
4584
4585--telnet-option can be used several times in a command line
4586
4587Example:
4588.nf
4589 curl -t TTYPE=vt100 telnet://example.com/
4590.fi
4591
4592See also \fI-K, --config\fP.
4593.IP "\-\-tftp-blksize <value>"
4594(TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will
4595try to use when transferring data to or from a TFTP server. By default 512
4596bytes will be used.
4597
4598If --tftp-blksize is provided several times, the last set value will be used.
4599
4600Example:
4601.nf
4602 curl --tftp-blksize 1024 tftp://example.com/file
4603.fi
4604
4605See also \fI--tftp-no-options\fP.
4606.IP "\-\-tftp-no-options"
4607(TFTP) Tells curl not to send TFTP options requests.
4608
4609This option improves interop with some legacy servers that do not acknowledge
4610or properly implement TFTP options. When this option is used \-\-tftp-blksize is
4611ignored.
4612
4613Providing --tftp-no-options multiple times has no extra effect.
4614Disable it again with --no-tftp-no-options.
4615
4616Example:
4617.nf
4618 curl --tftp-no-options tftp://192.168.0.1/
4619.fi
4620
4621See also \fI--tftp-blksize\fP. Added in 7.48.0.
4622.IP "\-z, \-\-time-cond <time>"
4623(HTTP FTP) Request a file that has been modified later than the given time and date, or
4624one that has been modified before that time. The <date expression> can be all
4625sorts of date strings or if it does not match any internal ones, it is taken as
4626a filename and tries to get the modification date (mtime) from <file>
4627instead. See the \fIcurl_getdate(3)\fP man pages for date expression details.
4628
4629Start the date expression with a dash (-) to make it request for a document
4630that is older than the given date/time, default is a document that is newer
4631than the specified date/time.
4632
4633If --time-cond is provided several times, the last set value will be used.
4634
4635Examples:
4636.nf
4637 curl -z "Wed 01 Sep 2021 12:18:00" https://example.com
4638 curl -z "-Wed 01 Sep 2021 12:18:00" https://example.com
4639 curl -z file https://example.com
4640.fi
4641
4642See also \fI--etag-compare\fP and \fI-R, --remote-time\fP.
4643.IP "\-\-tls-max <VERSION>"
4644(SSL) VERSION defines maximum supported TLS version. The minimum acceptable version
4645is set by tlsv1.0, tlsv1.1, tlsv1.2 or tlsv1.3.
4646
4647If the connection is done without TLS, this option has no effect. This
4648includes QUIC-using (HTTP/3) transfers.
4649
4650.RS
4651.IP "default"
4652Use up to recommended TLS version.
4653.IP "1.0"
4654Use up to TLSv1.0.
4655.IP "1.1"
4656Use up to TLSv1.1.
4657.IP "1.2"
4658Use up to TLSv1.2.
4659.IP "1.3"
4660Use up to TLSv1.3.
4661.RE
4662
4663If --tls-max is provided several times, the last set value will be used.
4664
4665Examples:
4666.nf
4667 curl --tls-max 1.2 https://example.com
4668 curl --tls-max 1.3 --tlsv1.2 https://example.com
4669.fi
4670
4671See also \fI--tlsv1.0\fP, \fI--tlsv1.1\fP, \fI--tlsv1.2\fP and \fI--tlsv1.3\fP. \fI--tls-max\fP requires that the underlying libcurl was built to support TLS. Added in 7.54.0.
4672.IP "\-\-tls13-ciphers <ciphersuite list>"
4673(TLS) Specifies which cipher suites to use in the connection if it negotiates TLS
46741.3. The list of ciphers suites must specify valid ciphers. Read up on TLS 1.3
4675cipher suite details on this URL:
4676
4677.nf
4678 https://curl.se/docs/ssl-ciphers.html
4679.fi
4680
4681This option is currently used only when curl is built to use OpenSSL 1.1.1 or
4682later. If you are using a different SSL backend you can try setting TLS 1.3
4683cipher suites by using the \-\-ciphers option.
4684
4685If --tls13-ciphers is provided several times, the last set value will be used.
4686
4687Example:
4688.nf
4689 curl --tls13-ciphers TLS_AES_128_GCM_SHA256 https://example.com
4690.fi
4691
4692See also \fI--ciphers\fP and \fI--curves\fP. Added in 7.61.0.
4693.IP "\-\-tlsauthtype <type>"
4694Set TLS authentication type. Currently, the only supported option is "SRP",
4695for TLS-SRP (RFC 5054). If \-\-tlsuser and \-\-tlspassword are specified but
4696\-\-tlsauthtype is not, then this option defaults to "SRP". This option works
4697only if the underlying libcurl is built with TLS-SRP support, which requires
4698OpenSSL or GnuTLS with TLS-SRP support.
4699
4700If --tlsauthtype is provided several times, the last set value will be used.
4701
4702Example:
4703.nf
4704 curl --tlsauthtype SRP https://example.com
4705.fi
4706
4707See also \fI--tlsuser\fP.
4708.IP "\-\-tlspassword <string>"
4709Set password for use with the TLS authentication method specified with
4710\fI\-\-tlsauthtype\fP. Requires that \-\-tlsuser also be set.
4711
4712This option does not work with TLS 1.3.
4713
4714If --tlspassword is provided several times, the last set value will be used.
4715
4716Example:
4717.nf
4718 curl --tlspassword pwd --tlsuser user https://example.com
4719.fi
4720
4721See also \fI--tlsuser\fP.
4722.IP "\-\-tlsuser <name>"
4723Set username for use with the TLS authentication method specified with
4724\fI\-\-tlsauthtype\fP. Requires that \-\-tlspassword also is set.
4725
4726This option does not work with TLS 1.3.
4727
4728If --tlsuser is provided several times, the last set value will be used.
4729
4730Example:
4731.nf
4732 curl --tlspassword pwd --tlsuser user https://example.com
4733.fi
4734
4735See also \fI--tlspassword\fP.
4736.IP "\-\-tlsv1.0"
4737(TLS) Forces curl to use TLS version 1.0 or later when connecting to a remote TLS server.
4738
4739In old versions of curl this option was documented to allow _only_ TLS 1.0.
4740That behavior was inconsistent depending on the TLS library. Use \-\-tls-max if
4741you want to set a maximum TLS version.
4742
4743Providing --tlsv1.0 multiple times has no extra effect.
4744
4745Example:
4746.nf
4747 curl --tlsv1.0 https://example.com
4748.fi
4749
4750See also \fI--tlsv1.3\fP. Added in 7.34.0.
4751.IP "\-\-tlsv1.1"
4752(TLS) Forces curl to use TLS version 1.1 or later when connecting to a remote TLS server.
4753
4754In old versions of curl this option was documented to allow _only_ TLS 1.1.
4755That behavior was inconsistent depending on the TLS library. Use \-\-tls-max if
4756you want to set a maximum TLS version.
4757
4758Providing --tlsv1.1 multiple times has no extra effect.
4759
4760Example:
4761.nf
4762 curl --tlsv1.1 https://example.com
4763.fi
4764
4765See also \fI--tlsv1.3\fP and \fI--tls-max\fP. Added in 7.34.0.
4766.IP "\-\-tlsv1.2"
4767(TLS) Forces curl to use TLS version 1.2 or later when connecting to a remote TLS server.
4768
4769In old versions of curl this option was documented to allow _only_ TLS 1.2.
4770That behavior was inconsistent depending on the TLS library. Use \-\-tls-max if
4771you want to set a maximum TLS version.
4772
4773Providing --tlsv1.2 multiple times has no extra effect.
4774
4775Example:
4776.nf
4777 curl --tlsv1.2 https://example.com
4778.fi
4779
4780See also \fI--tlsv1.3\fP and \fI--tls-max\fP. Added in 7.34.0.
4781.IP "\-\-tlsv1.3"
4782(TLS) Forces curl to use TLS version 1.3 or later when connecting to a remote TLS
4783server.
4784
4785If the connection is done without TLS, this option has no effect. This
4786includes QUIC-using (HTTP/3) transfers.
4787
4788Note that TLS 1.3 is not supported by all TLS backends.
4789
4790Providing --tlsv1.3 multiple times has no extra effect.
4791
4792Example:
4793.nf
4794 curl --tlsv1.3 https://example.com
4795.fi
4796
4797See also \fI--tlsv1.2\fP and \fI--tls-max\fP. Added in 7.52.0.
4798.IP "\-1, \-\-tlsv1"
4799(SSL) Tells curl to use at least TLS version 1.x when negotiating with a remote TLS
4800server. That means TLS version 1.0 or higher
4801
4802Providing --tlsv1 multiple times has no extra effect.
4803
4804Example:
4805.nf
4806 curl --tlsv1 https://example.com
4807.fi
4808
4809See 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 is mutually exclusive to \fI--tlsv1.1\fP and \fI--tlsv1.2\fP and \fI--tlsv1.3\fP.
4810.IP "\-\-tr-encoding"
4811(HTTP) Request a compressed Transfer-Encoding response using one of the algorithms
4812curl supports, and uncompress the data while receiving it.
4813
4814Providing --tr-encoding multiple times has no extra effect.
4815Disable it again with --no-tr-encoding.
4816
4817Example:
4818.nf
4819 curl --tr-encoding https://example.com
4820.fi
4821
4822See also \fI--compressed\fP.
4823.IP "\-\-trace-ascii <file>"
4824Enables a full trace dump of all incoming and outgoing data, including
4825descriptive information, to the given output file. Use "-" as filename to have
4826the output sent to stdout.
4827
4828This is similar to \fI\-\-trace\fP, but leaves out the hex part and only shows the
4829ASCII part of the dump. It makes smaller output that might be easier to read
4830for untrained humans.
4831
4832This option is global and does not need to be specified for each use of
4833\fI\-:, \-\-next\fP.
4834
4835If --trace-ascii is provided several times, the last set value will be used.
4836
4837Example:
4838.nf
4839 curl --trace-ascii log.txt https://example.com
4840.fi
4841
4842See also \fI-v, --verbose\fP and \fI--trace\fP. This option is mutually exclusive to \fI--trace\fP and \fI-v, --verbose\fP.
4843.IP "\-\-trace-time"
4844Prepends a time stamp to each trace or verbose line that curl displays.
4845
4846This option is global and does not need to be specified for each use of
4847\fI\-:, \-\-next\fP.
4848
4849Providing --trace-time multiple times has no extra effect.
4850Disable it again with --no-trace-time.
4851
4852Example:
4853.nf
4854 curl --trace-time --trace-ascii output https://example.com
4855.fi
4856
4857See also \fI--trace\fP and \fI-v, --verbose\fP.
4858.IP "\-\-trace <file>"
4859Enables a full trace dump of all incoming and outgoing data, including
4860descriptive information, to the given output file. Use "-" as filename to have
4861the output sent to stdout. Use "%" as filename to have the output sent to
4862stderr.
4863
4864This option is global and does not need to be specified for each use of
4865\fI\-:, \-\-next\fP.
4866
4867If --trace is provided several times, the last set value will be used.
4868
4869Example:
4870.nf
4871 curl --trace log.txt https://example.com
4872.fi
4873
4874See also \fI--trace-ascii\fP and \fI--trace-time\fP. This option is mutually exclusive to \fI-v, --verbose\fP and \fI--trace-ascii\fP.
4875.IP "\-\-unix-socket <path>"
4876(HTTP) Connect through this Unix domain socket, instead of using the network.
4877
4878If --unix-socket is provided several times, the last set value will be used.
4879
4880Example:
4881.nf
4882 curl --unix-socket socket-path https://example.com
4883.fi
4884
4885See also \fI--abstract-unix-socket\fP. Added in 7.40.0.
4886.IP "\-T, \-\-upload-file <file>"
4887This transfers the specified local file to the remote URL. If there is no file
4888part in the specified URL, curl will append the local file name. NOTE that you
4889must use a trailing / on the last directory to really prove to Curl that there
4890is no file name or curl will think that your last directory name is the remote
4891file name to use. That will most likely cause the upload operation to fail. If
4892this is used on an HTTP(S) server, the PUT command will be used.
4893
4894Use the file name "-" (a single dash) to use stdin instead of a given file.
4895Alternately, the file name "." (a single period) may be specified instead of
4896\(dq-" to use stdin in non-blocking mode to allow reading server output while
4897stdin is being uploaded.
4898
4899You can specify one \-\-upload-file for each URL on the command line. Each
4900\fI\-T, \-\-upload-file\fP + URL pair specifies what to upload and to where. curl also
4901supports "globbing" of the \-\-upload-file argument, meaning that you can upload
4902multiple files to a single URL by using the same URL globbing style supported
4903in the URL.
4904
4905When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
4906formatted. It has to feature the necessary set of headers and mail body
4907formatted correctly by the user as curl will not transcode nor encode it
4908further in any way.
4909
4910--upload-file can be used several times in a command line
4911
4912Examples:
4913.nf
4914 curl -T file https://example.com
4915 curl -T "img[1-1000].png" ftp://ftp.example.com/
4916 curl --upload-file "{file1,file2}" https://example.com
4917.fi
4918
4919See also \fI-G, --get\fP and \fI-I, --head\fP.
4920.IP "\-\-url <url>"
4921Specify a URL to fetch. This option is mostly handy when you want to specify
4922URL(s) in a config file.
4923
4924If the given URL is missing a scheme name (such as "http://" or "ftp://" etc)
4925then curl will make a guess based on the host. If the outermost sub-domain
4926name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be
4927used, otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by
4928setting a default protocol, see \-\-proto-default for details.
4929
4930To control where this URL is written, use the \-\-output or the \-\-remote-name
4931options.
4932
4933\fBWARNING\fP: On Windows, particular file:// accesses can be converted to
4934network accesses by the operating system. Beware!
4935
4936--url can be used several times in a command line
4937
4938Example:
4939.nf
4940 curl --url https://example.com
4941.fi
4942
4943See also \fI-:, --next\fP and \fI-K, --config\fP.
4944.IP "\-B, \-\-use-ascii"
4945(FTP LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using a URL that
4946ends with ";type=A". This option causes data sent to stdout to be in text mode
4947for win32 systems.
4948
4949Providing --use-ascii multiple times has no extra effect.
4950Disable it again with --no-use-ascii.
4951
4952Example:
4953.nf
4954 curl -B ftp://example.com/README
4955.fi
4956
4957See also \fI--crlf\fP and \fI--data-ascii\fP.
4958.IP "\-A, \-\-user-agent <name>"
4959(HTTP) Specify the User-Agent string to send to the HTTP server. To encode blanks in
4960the string, surround the string with single quote marks. This header can also
4961be set with the \-\-header or the \-\-proxy-header options.
4962
4963If you give an empty argument to \fI\-A, \-\-user-agent\fP (""), it will remove the header
4964completely from the request. If you prefer a blank header, you can set it to a
4965single space (" ").
4966
4967If --user-agent is provided several times, the last set value will be used.
4968
4969Example:
4970.nf
4971 curl -A "Agent 007" https://example.com
4972.fi
4973
4974See also \fI-H, --header\fP and \fI--proxy-header\fP.
4975.IP "\-u, \-\-user <user:password>"
4976Specify the user name and password to use for server authentication. Overrides
4977\-\-netrc and \fI\-\-netrc-optional\fP.
4978
4979If you simply specify the user name, curl will prompt for a password.
4980
4981The user name and passwords are split up on the first colon, which makes it
4982impossible to use a colon in the user name with this option. The password can,
4983still.
4984
4985On systems where it works, curl will hide the given option argument from
4986process listings. This is not enough to protect credentials from possibly
4987getting seen by other users on the same system as they will still be visible
4988for a moment before cleared. Such sensitive data should be retrieved from a
4989file instead or similar and never used in clear text in a command line.
4990
4991When using Kerberos V5 with a Windows based server you should include the
4992Windows domain name in the user name, in order for the server to successfully
4993obtain a Kerberos Ticket. If you do not, then the initial authentication
4994handshake may fail.
4995
4996When using NTLM, the user name can be specified simply as the user name,
4997without the domain, if there is a single domain and forest in your setup
4998for example.
4999
5000To specify the domain name use either Down-Level Logon Name or UPN (User
5001Principal Name) formats. For example, EXAMPLE\\user and user@example.com
5002respectively.
5003
5004If you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
5005Negotiate, NTLM or Digest authentication then you can tell curl to select
5006the user name and password from your environment by specifying a single colon
5007with this option: "-u :".
5008
5009If --user is provided several times, the last set value will be used.
5010
5011Example:
5012.nf
5013 curl -u user:secret https://example.com
5014.fi
5015
5016See also \fI-n, --netrc\fP and \fI-K, --config\fP.
5017.IP "\-v, \-\-verbose"
5018Makes curl verbose during the operation. Useful for debugging and seeing
5019what's going on "under the hood". A line starting with '>' means "header data"
5020sent by curl, '<' means "header data" received by curl that is hidden in
5021normal cases, and a line starting with '*' means additional info provided by
5022curl.
5023
5024If you only want HTTP headers in the output, \-\-include might be the option
5025you are looking for.
5026
5027If you think this option still does not give you enough details, consider using
5028\-\-trace or \-\-trace-ascii instead.
5029
5030This option is global and does not need to be specified for each use of
5031\fI\-:, \-\-next\fP.
5032
5033Use \-\-silent to make curl really quiet.
5034
5035Providing --verbose multiple times has no extra effect.
5036Disable it again with --no-verbose.
5037
5038Example:
5039.nf
5040 curl --verbose https://example.com
5041.fi
5042
5043See also \fI-i, --include\fP. This option is mutually exclusive to \fI--trace\fP and \fI--trace-ascii\fP.
5044.IP "\-V, \-\-version"
5045Displays information about curl and the libcurl version it uses.
5046
5047The first line includes the full version of curl, libcurl and other 3rd party
5048libraries linked with the executable.
5049
5050The second line (starts with "Protocols:") shows all protocols that libcurl
5051reports to support.
5052
5053The third line (starts with "Features:") shows specific features libcurl
5054reports to offer. Available features include:
5055.RS
5056.IP "alt-svc"
5057Support for the Alt-Svc: header is provided.
5058.IP "AsynchDNS"
5059This curl uses asynchronous name resolves. Asynchronous name resolves can be
5060done using either the c-ares or the threaded resolver backends.
5061.IP "brotli"
5062Support for automatic brotli compression over HTTP(S).
5063.IP "CharConv"
5064curl was built with support for character set conversions (like EBCDIC)
5065.IP "Debug"
5066This curl uses a libcurl built with Debug. This enables more error-tracking
5067and memory debugging etc. For curl-developers only!
5068.IP "gsasl"
5069The built-in SASL authentication includes extensions to support SCRAM because
5070libcurl was built with libgsasl.
5071.IP "GSS-API"
5072GSS-API is supported.
5073.IP "HSTS"
5074HSTS support is present.
5075.IP "HTTP2"
5076HTTP/2 support has been built-in.
5077.IP "HTTP3"
5078HTTP/3 support has been built-in.
5079.IP "HTTPS-proxy"
5080This curl is built to support HTTPS proxy.
5081.IP "IDN"
5082This curl supports IDN \- international domain names.
5083.IP "IPv6"
5084You can use IPv6 with this.
5085.IP "Kerberos"
5086Kerberos V5 authentication is supported.
5087.IP "Largefile"
5088This curl supports transfers of large files, files larger than 2GB.
5089.IP "libz"
5090Automatic decompression (via gzip, deflate) of compressed files over HTTP is
5091supported.
5092.IP "MultiSSL"
5093This curl supports multiple TLS backends.
5094.IP "NTLM"
5095NTLM authentication is supported.
5096.IP "NTLM_WB"
5097NTLM delegation to winbind helper is supported.
5098.IP "PSL"
5099PSL is short for Public Suffix List and means that this curl has been built
5100with knowledge about "public suffixes".
5101.IP "SPNEGO"
5102SPNEGO authentication is supported.
5103.IP "SSL"
5104SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S
5105and so on.
5106.IP "SSPI"
5107SSPI is supported.
5108.IP "TLS-SRP"
5109SRP (Secure Remote Password) authentication is supported for TLS.
5110.IP "TrackMemory"
5111Debug memory tracking is supported.
5112.IP "Unicode"
5113Unicode support on Windows.
5114.IP "UnixSockets"
5115Unix sockets support is provided.
5116.IP "zstd"
5117Automatic decompression (via zstd) of compressed files over HTTP is supported.
5118.RE
5119
5120Providing --version multiple times has no extra effect.
5121Disable it again with --no-version.
5122
5123Example:
5124.nf
5125 curl --version
5126.fi
5127
5128See also \fI-h, --help\fP and \fI-M, --manual\fP.
5129.IP "\-w, \-\-write-out <format>"
5130Make curl display information on stdout after a completed transfer. The format
5131is a string that may contain plain text mixed with any number of
5132variables. The format can be specified as a literal "string", or you can have
5133curl read the format from a file with "@filename" and to tell curl to read the
5134format from stdin you write "@-".
5135
5136The variables present in the output format will be substituted by the value or
5137text that curl thinks fit, as described below. All variables are specified as
5138%{variable_name} and to output a normal % you just write them as %%. You can
5139output a newline by using \\n, a carriage return with \\r and a tab space with
5140\\t.
5141
5142The output will be written to standard output, but this can be switched to
5143standard error by using %{stderr}.
5144
5145Output HTTP headers from the most recent request by using \fB%header{name}\fP
5146where \fBname\fP is the case insensitive name of the header (without the
5147trailing colon). The header contents are exactly as sent over the network,
5148with leading and trailing whitespace trimmed. Added in curl 7.84.0.
5149
5150.B NOTE:
5151The %-symbol is a special symbol in the win32-environment, where all
5152occurrences of % must be doubled when using this option.
5153
5154The variables available are:
5155.RS
5156.TP 15
5157.B content_type
5158The Content-Type of the requested document, if there was any.
5159.TP
5160.B errormsg
5161The error message. (Added in 7.75.0)
5162.TP
5163.B exitcode
5164The numerical exitcode of the transfer. (Added in 7.75.0)
5165.TP
5166.B filename_effective
5167The ultimate filename that curl writes out to. This is only meaningful if curl
5168is told to write to a file with the \-\-remote-name or \-\-output
5169option. It's most useful in combination with the \-\-remote-header-name
5170option.
5171.TP
5172.B ftp_entry_path
5173The initial path curl ended up in when logging on to the remote FTP
5174server.
5175.TP
5176.B header_json
5177A JSON object with all HTTP response headers from the recent transfer. Values
5178are provided as arrays, since in the case of multiple headers there can be
5179multiple values.
5180
5181The header names provided in lowercase, listed in order of appearance over the
5182wire. Except for duplicated headers. They are grouped on the first occurrence
5183of that header, each value is presented in the JSON array.
5184.TP
5185.B http_code
5186The numerical response code that was found in the last retrieved HTTP(S) or
5187FTP(s) transfer.
5188.TP
5189.B http_connect
5190The numerical code that was found in the last response (from a proxy) to a
5191curl CONNECT request.
5192.TP
5193.B http_version
5194The http version that was effectively used. (Added in 7.50.0)
5195.TP
5196.B json
5197A JSON object with all available keys.
5198.TP
5199.B local_ip
5200The IP address of the local end of the most recently done connection \- can be
5201either IPv4 or IPv6.
5202.TP
5203.B local_port
5204The local port number of the most recently done connection.
5205.TP
5206.B method
5207The http method used in the most recent HTTP request. (Added in 7.72.0)
5208.TP
5209.B num_connects
5210Number of new connects made in the recent transfer.
5211.TP
5212.B num_headers
5213The number of response headers in the most recent request (restarted at each
5214redirect). Note that the status line IS NOT a header. (Added in 7.73.0)
5215.TP
5216.B num_redirects
5217Number of redirects that were followed in the request.
5218.TP
5219.B onerror
5220The rest of the output is only shown if the transfer returned a non-zero error
5221(Added in 7.75.0)
5222.TP
5223.B proxy_ssl_verify_result
5224The result of the HTTPS proxy's SSL peer certificate verification that was
5225requested. 0 means the verification was successful. (Added in 7.52.0)
5226.TP
5227.B redirect_url
5228When an HTTP request was made without \-\-location to follow redirects (or when
5229\-\-max-redirs is met), this variable will show the actual URL a redirect
5230\fIwould\fP have gone to.
5231.TP
5232.B referer
5233The Referer: header, if there was any. (Added in 7.76.0)
5234.TP
5235.B remote_ip
5236The remote IP address of the most recently done connection \- can be either
5237IPv4 or IPv6.
5238.TP
5239.B remote_port
5240The remote port number of the most recently done connection.
5241.TP
5242.B response_code
5243The numerical response code that was found in the last transfer (formerly
5244known as "http_code").
5245.TP
5246.B scheme
5247The URL scheme (sometimes called protocol) that was effectively used. (Added in 7.52.0)
5248.TP
5249.B size_download
5250The total amount of bytes that were downloaded. This is the size of the
5251body/data that was transferred, excluding headers.
5252.TP
5253.B size_header
5254The total amount of bytes of the downloaded headers.
5255.TP
5256.B size_request
5257The total amount of bytes that were sent in the HTTP request.
5258.TP
5259.B size_upload
5260The total amount of bytes that were uploaded. This is the size of the
5261body/data that was transferred, excluding headers.
5262.TP
5263.B speed_download
5264The average download speed that curl measured for the complete download. Bytes
5265per second.
5266.TP
5267.B speed_upload
5268The average upload speed that curl measured for the complete upload. Bytes per
5269second.
5270.TP
5271.B ssl_verify_result
5272The result of the SSL peer certificate verification that was requested. 0
5273means the verification was successful.
5274.TP
5275.B stderr
5276From this point on, the \-\-write-out output will be written to standard
5277error. (Added in 7.63.0)
5278.TP
5279.B stdout
5280From this point on, the \-\-write-out output will be written to standard output.
5281This is the default, but can be used to switch back after switching to stderr.
5282(Added in 7.63.0)
5283.TP
5284.B time_appconnect
5285The time, in seconds, it took from the start until the SSL/SSH/etc
5286connect/handshake to the remote host was completed.
5287.TP
5288.B time_connect
5289The time, in seconds, it took from the start until the TCP connect to the
5290remote host (or proxy) was completed.
5291.TP
5292.B time_namelookup
5293The time, in seconds, it took from the start until the name resolving was
5294completed.
5295.TP
5296.B time_pretransfer
5297The time, in seconds, it took from the start until the file transfer was just
5298about to begin. This includes all pre-transfer commands and negotiations that
5299are specific to the particular protocol(s) involved.
5300.TP
5301.B time_redirect
5302The time, in seconds, it took for all redirection steps including name lookup,
5303connect, pretransfer and transfer before the final transaction was
5304started. time_redirect shows the complete execution time for multiple
5305redirections.
5306.TP
5307.B time_starttransfer
5308The time, in seconds, it took from the start until the first byte was just
5309about to be transferred. This includes time_pretransfer and also the time the
5310server needed to calculate the result.
5311.TP
5312.B time_total
5313The total time, in seconds, that the full operation lasted.
5314.TP
5315.B url
5316The URL that was fetched. (Added in 7.75.0)
5317.TP
5318.B urlnum
5319The URL index number of this transfer, 0-indexed. De-globbed URLs share the
5320same index number as the origin globbed URL. (Added in 7.75.0)
5321.TP
5322.B url_effective
5323The URL that was fetched last. This is most meaningful if you have told curl
5324to follow location: headers.
5325.RE
5326.IP
5327
5328If --write-out is provided several times, the last set value will be used.
5329
5330Example:
5331.nf
5332 curl -w '%{http_code}\\n' https://example.com
5333.fi
5334
5335See also \fI-v, --verbose\fP and \fI-I, --head\fP.
5336.IP "\-\-xattr"
5337When saving output to a file, this option tells curl to store certain file
5338metadata in extended file attributes. Currently, the URL is stored in the
5339xdg.origin.url attribute and, for HTTP, the content type is stored in
5340the mime_type attribute. If the file system does not support extended
5341attributes, a warning is issued.
5342
5343Providing --xattr multiple times has no extra effect.
5344Disable it again with --no-xattr.
5345
5346Example:
5347.nf
5348 curl --xattr -o storage https://example.com
5349.fi
5350
5351See also \fI-R, --remote-time\fP, \fI-w, --write-out\fP and \fI-v, --verbose\fP.
5352.SH FILES
5353.I ~/.curlrc
5354.RS
5355Default config file, see \-\-config for details.
5356.SH ENVIRONMENT
5357The environment variables can be specified in lower case or upper case. The
5358lower case version has precedence. http_proxy is an exception as it is only
5359available in lower case.
5360
5361Using an environment variable to set the proxy has the same effect as using
5362the \-\-proxy option.
5363
5364.IP "http_proxy [protocol://]<host>[:port]"
5365Sets the proxy server to use for HTTP.
5366.IP "HTTPS_PROXY [protocol://]<host>[:port]"
5367Sets the proxy server to use for HTTPS.
5368.IP "[url-protocol]_PROXY [protocol://]<host>[:port]"
5369Sets the proxy server to use for [url-protocol], where the protocol is a
5370protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP,
5371SMTP, LDAP, etc.
5372.IP "ALL_PROXY [protocol://]<host>[:port]"
5373Sets the proxy server to use if no protocol-specific proxy is set.
5374.IP "NO_PROXY <comma-separated list of hosts/domains>"
5375list of host names that should not go through any proxy. If set to an asterisk
5376\(aq*' only, it matches all hosts. Each name in this list is matched as either
5377a domain name which contains the hostname, or the hostname itself.
5378
5379This environment variable disables use of the proxy even when specified with
5380the \-\-proxy option. That is
5381.B NO_PROXY=direct.example.com curl \-x http://proxy.example.com
5382.B http://direct.example.com
5383accesses the target URL directly, and
5384.B NO_PROXY=direct.example.com curl \-x http://proxy.example.com
5385.B http://somewhere.example.com
5386accesses the target URL through the proxy.
5387
5388The list of host names can also be include numerical IP addresses, and IPv6
5389versions should then be given without enclosing brackets.
5390
5391IPv6 numerical addresses are compared as strings, so they will only match if
5392the representations are the same: "::1" is the same as "::0:1" but they do not
5393match.
5394.IP "APPDATA <dir>"
5395On Windows, this variable is used when trying to find the home directory. If
5396the primary home variable are all unset.
5397.IP "COLUMNS <terminal width>"
5398If set, the specified number of characters will be used as the terminal width
5399when the alternative progress-bar is shown. If not set, curl will try to
5400figure it out using other ways.
5401.IP "CURL_CA_BUNDLE <file>"
5402If set, will be used as the \fI\-\-cacert\fP value.
5403.IP "CURL_HOME <dir>"
5404If set, is the first variable curl checks when trying to find its home
5405directory. If not set, it continues to check \fBXDG_CONFIG_HOME\fP.
5406.IP "CURL_SSL_BACKEND <TLS backend>"
5407If curl was built with support for "MultiSSL", meaning that it has built-in
5408support for more than one TLS backend, this environment variable can be set to
5409the case insensitive name of the particular backend to use when curl is
5410invoked. Setting a name that is not a built-in alternative will make curl
5411stay with the default.
5412
5413SSL backend names (case-insensitive): bearssl, gnutls, gskit, mbedtls,
5414nss, openssl, rustls, schannel, secure-transport, wolfssl
5415.IP "HOME <dir>"
5416If set, this is used to find the home directory when that is needed. Like when
5417looking for the default .curlrc. \fBCURL_HOME\fP and \fBXDG_CONFIG_HOME\fP
5418have preference.
5419.IP "QLOGDIR <directory name>"
5420If curl was built with HTTP/3 support, setting this environment variable to a
5421local directory will make curl produce qlogs in that directory, using file
5422names named after the destination connection id (in hex). Do note that these
5423files can become rather large. Works with both QUIC backends.
5424.IP SHELL
5425Used on VMS when trying to detect if using a DCL or a "unix" shell.
5426.IP "SSL_CERT_DIR <dir>"
5427If set, will be used as the \fI\-\-capath\fP value.
5428.IP "SSL_CERT_FILE <path>"
5429If set, will be used as the \fI\-\-cacert\fP value.
5430.IP "SSLKEYLOGFILE <file name>"
5431If you set this environment variable to a file name, curl will store TLS
5432secrets from its connections in that file when invoked to enable you to
5433analyze the TLS traffic in real time using network analyzing tools such as
5434Wireshark. This works with the following TLS backends: OpenSSL, libressl,
5435BoringSSL, GnuTLS, NSS and wolfSSL.
5436.IP "USERPROFILE <dir>"
5437On Windows, this variable is used when trying to find the home directory. If
5438the other, primary, variable are all unset. If set, curl will use the path
5439\(dq$USERPROFILE\\Application Data".
5440.IP "XDG_CONFIG_HOME <dir>"
5441If \fBCURL_HOME\fP is not set, this variable is checked when looking for a
5442default .curlrc file.
5443.SH "PROXY PROTOCOL PREFIXES"
5444The proxy string may be specified with a protocol:// prefix to specify
5445alternative proxy protocols.
5446
5447If no protocol is specified in the proxy string or if the string does not match
5448a supported one, the proxy will be treated as an HTTP proxy.
5449
5450The supported proxy protocol prefixes are as follows:
5451.IP "http://"
5452Makes it use it as an HTTP proxy. The default if no scheme prefix is used.
5453.IP "https://"
5454Makes it treated as an \fBHTTPS\fP proxy.
5455.IP "socks4://"
5456Makes it the equivalent of \-\-socks4
5457.IP "socks4a://"
5458Makes it the equivalent of \-\-socks4a
5459.IP "socks5://"
5460Makes it the equivalent of \-\-socks5
5461.IP "socks5h://"
5462Makes it the equivalent of \-\-socks5-hostname
5463.SH EXIT CODES
5464There are a bunch of different error codes and their corresponding error
5465messages that may appear under error conditions. At the time of this writing,
5466the exit codes are:
5467.IP 0
5468Success. The operation completed successfully according to the instructions.
5469.IP 1
5470Unsupported protocol. This build of curl has no support for this protocol.
5471.IP 2
5472Failed to initialize.
5473.IP 3
5474URL malformed. The syntax was not correct.
5475.IP 4
5476A feature or option that was needed to perform the desired request was not
5477enabled or was explicitly disabled at build-time. To make curl able to do
5478this, you probably need another build of libcurl.
5479.IP 5
5480Could not resolve proxy. The given proxy host could not be resolved.
5481.IP 6
5482Could not resolve host. The given remote host could not be resolved.
5483.IP 7
5484Failed to connect to host.
5485.IP 8
5486Weird server reply. The server sent data curl could not parse.
5487.IP 9
5488FTP access denied. The server denied login or denied access to the particular
5489resource or directory you wanted to reach. Most often you tried to change to a
5490directory that does not exist on the server.
5491.IP 10
5492FTP accept failed. While waiting for the server to connect back when an active
5493FTP session is used, an error code was sent over the control connection or
5494similar.
5495.IP 11
5496FTP weird PASS reply. Curl could not parse the reply sent to the PASS request.
5497.IP 12
5498During an active FTP session while waiting for the server to connect back to
5499curl, the timeout expired.
5500.IP 13
5501FTP weird PASV reply, Curl could not parse the reply sent to the PASV request.
5502.IP 14
5503FTP weird 227 format. Curl could not parse the 227-line the server sent.
5504.IP 15
5505FTP cannot use host. Could not resolve the host IP we got in the 227-line.
5506.IP 16
5507HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is
5508somewhat generic and can be one out of several problems, see the error message
5509for details.
5510.IP 17
5511FTP could not set binary. Could not change transfer method to binary.
5512.IP 18
5513Partial file. Only a part of the file was transferred.
5514.IP 19
5515FTP could not download/access the given file, the RETR (or similar) command
5516failed.
5517.IP 21
5518FTP quote error. A quote command returned error from the server.
5519.IP 22
5520HTTP page not retrieved. The requested URL was not found or returned another
5521error with the HTTP error code being 400 or above. This return code only
5522appears if \-\-fail is used.
5523.IP 23
5524Write error. Curl could not write data to a local filesystem or similar.
5525.IP 25
5526FTP could not STOR file. The server denied the STOR operation, used for FTP
5527uploading.
5528.IP 26
5529Read error. Various reading problems.
5530.IP 27
5531Out of memory. A memory allocation request failed.
5532.IP 28
5533Operation timeout. The specified time-out period was reached according to the
5534conditions.
5535.IP 30
5536FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT
5537command, try doing a transfer using PASV instead!
5538.IP 31
5539FTP could not use REST. The REST command failed. This command is used for
5540resumed FTP transfers.
5541.IP 33
5542HTTP range error. The range "command" did not work.
5543.IP 34
5544HTTP post error. Internal post-request generation error.
5545.IP 35
5546SSL connect error. The SSL handshaking failed.
5547.IP 36
5548Bad download resume. Could not continue an earlier aborted download.
5549.IP 37
5550FILE could not read file. Failed to open the file. Permissions?
5551.IP 38
5552LDAP cannot bind. LDAP bind operation failed.
5553.IP 39
5554LDAP search failed.
5555.IP 41
5556Function not found. A required LDAP function was not found.
5557.IP 42
5558Aborted by callback. An application told curl to abort the operation.
5559.IP 43
5560Internal error. A function was called with a bad parameter.
5561.IP 45
5562Interface error. A specified outgoing interface could not be used.
5563.IP 47
5564Too many redirects. When following redirects, curl hit the maximum amount.
5565.IP 48
5566Unknown option specified to libcurl. This indicates that you passed a weird
5567option to curl that was passed on to libcurl and rejected. Read up in the
5568manual!
5569.IP 49
5570Malformed telnet option.
5571.IP 52
5572The server did not reply anything, which here is considered an error.
5573.IP 53
5574SSL crypto engine not found.
5575.IP 54
5576Cannot set SSL crypto engine as default.
5577.IP 55
5578Failed sending network data.
5579.IP 56
5580Failure in receiving network data.
5581.IP 58
5582Problem with the local certificate.
5583.IP 59
5584Could not use specified SSL cipher.
5585.IP 60
5586Peer certificate cannot be authenticated with known CA certificates.
5587.IP 61
5588Unrecognized transfer encoding.
5589.IP 63
5590Maximum file size exceeded.
5591.IP 64
5592Requested FTP SSL level failed.
5593.IP 65
5594Sending the data requires a rewind that failed.
5595.IP 66
5596Failed to initialise SSL Engine.
5597.IP 67
5598The user name, password, or similar was not accepted and curl failed to log in.
5599.IP 68
5600File not found on TFTP server.
5601.IP 69
5602Permission problem on TFTP server.
5603.IP 70
5604Out of disk space on TFTP server.
5605.IP 71
5606Illegal TFTP operation.
5607.IP 72
5608Unknown TFTP transfer ID.
5609.IP 73
5610File already exists (TFTP).
5611.IP 74
5612No such user (TFTP).
5613.IP 77
5614Problem reading the SSL CA cert (path? access rights?).
5615.IP 78
5616The resource referenced in the URL does not exist.
5617.IP 79
5618An unspecified error occurred during the SSH session.
5619.IP 80
5620Failed to shut down the SSL connection.
5621.IP 82
5622Could not load CRL file, missing or wrong format.
5623.IP 83
5624Issuer check failed.
5625.IP 84
5626The FTP PRET command failed.
5627.IP 85
5628Mismatch of RTSP CSeq numbers.
5629.IP 86
5630Mismatch of RTSP Session Identifiers.
5631.IP 87
5632Unable to parse FTP file list.
5633.IP 88
5634FTP chunk callback reported error.
5635.IP 89
5636No connection available, the session will be queued.
5637.IP 90
5638SSL public key does not matched pinned public key.
5639.IP 91
5640Invalid SSL certificate status.
5641.IP 92
5642Stream error in HTTP/2 framing layer.
5643.IP 93
5644An API function was called from inside a callback.
5645.IP 94
5646An authentication function returned an error.
5647.IP 95
5648A problem was detected in the HTTP/3 layer. This is somewhat generic and can
5649be one out of several problems, see the error message for details.
5650.IP 96
5651QUIC connection error. This error may be caused by an SSL library error. QUIC
5652is the protocol used for HTTP/3 transfers.
5653.IP XX
5654More error codes will appear here in future releases. The existing ones
5655are meant to never change.
5656.SH BUGS
5657If you experience any problems with curl, submit an issue in the project's bug
5658tracker on GitHub: https://github.com/curl/curl/issues
5659.SH AUTHORS / CONTRIBUTORS
5660Daniel Stenberg is the main author, but the whole list of contributors is
5661found in the separate THANKS file.
5662.SH WWW
5663https://curl.se
5664.SH "SEE ALSO"
5665.BR ftp (1),
5666.BR wget (1)