neulab/tldr huggingface dataset:
-:, --next will reset all local options and only global ones will have their values survive over to the operation following the -:, --next instruction. Global options include -v, --verbose, --trace, --trace-ascii and --fail-early.
For example, you can do both a GET and a POST in a single command line:
curl www1.example.com --next -d postthis www2.example.com
Examples: curl https://example.com --next -d postthis www2.example.com curl -I https://example.com --next https://example.net/
Added in 7.36.0.
--no-alpn (HTTPS) Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built with an SSL library that supports ALPN. ALPN is used by a libcurl that supports HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
Example: curl --no-alpn https://example.com
See also --no-npn and --http2. --no-alpn requires that the underlying libcurl was built to support TLS. Added in 7.36.0.
-N, --no-buffer Disables the buffering of the output stream. In normal work situations, curl will use a standard buffered output stream that will have the effect that it will output the data in chunks, not necessarily exactly when the data arrives.  Using this option will disable that buffering.
Note that this is the negated option name documented. You can thus use --buffer to enforce the buffering.
Example: curl --no-buffer https://example.com
--no-keepalive Disables the use of keepalive messages on the TCP connection. curl otherwise enables them by default.
Note that this is the negated option name documented. You can thus use --keepalive to enforce keepalive.
Example: curl --no-keepalive https://example.com
--no-npn (HTTPS) Disable the NPN TLS extension. NPN is enabled by default if libcurl was built with an SSL library that supports NPN. NPN is used by a libcurl that supports HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
Example: curl --no-npn https://example.com
See also --no-alpn and --http2. --no-npn requires that the underlying libcurl was built to support TLS. Added in 7.36.0.
--no-progress-meter Option to switch off the progress meter output without muting or otherwise affecting warning and informational messages like -s, --silent does.
Note that this is the negated option name documented. You can thus use --progress-meter to enable the progress meter again.
Example: curl --no-progress-meter -o store https://example.com
See also -v, --verbose and -s, --silent. Added in 7.67.0.
--no-sessionid (TLS) Disable curl's use of SSL session-ID caching.  By default all transfers are done using the cache. Note that while nothing should ever get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed.
Note that this is the negated option name documented. You can thus use --sessionid to enforce session-ID caching.
Example: curl --no-sessionid https://example.com
--noproxy <no-proxy-list> Comma-separated list of hosts for which not to use a proxy, if one is specified. The only wildcard is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, local.com would match local.com, local.com:80, and www.local.com, but not www.notlocal.com.
Since 7.53.0, This option overrides the environment variables that disable the proxy ('no_proxy' and 'NO_PROXY'). If there's an environment variable disabling a proxy, you can set the noproxy list to "" to override it.
Example: curl --noproxy "www.example" https://example.com
--ntlm-wb (HTTP) Enables NTLM much in the style --ntlm does, but hand over the authentication to the separate binary ntlmauth application that is executed when needed.
Example: curl --ntlm-wb -u user:password https://example.com
See also --ntlm and --proxy-ntlm.
--ntlm (HTTP) Enables NTLM authentication. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead, such as Digest.
If you want to enable NTLM for your proxy authentication, then use --proxy-ntlm.
Example: curl --ntlm -u user:password https://example.com
See also --proxy-ntlm. --ntlm requires that the underlying libcurl was built to support TLS. This option overrides --basic and --negotiate and --digest and --anyauth.
--oauth2-bearer <token> (IMAP POP3 SMTP HTTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token is used in conjunction with the user name which can be specified as part of the --url or -u, --user options.
The Bearer Token and user name are formatted according to RFC 6750.
Example: curl --oauth2-bearer "mF_9.B5f-4.1JqM" https://example.com
Added in 7.33.0.
--output-dir <dir>
This option specifies the directory in which files should be stored, when -O, --remote-name or -o, --output are used.
The given output directory is used for all URLs and output options on the command line, up until the first -:, --next.
If the specified target directory does not exist, the operation will fail unless --create-dirs is also used.
If this option is used multiple times, the last specified directory will be used.
Example: curl --output-dir "tmp" -O https://example.com
See also -O, --remote-name and -J, --remote-header-name. Added in 7.73.0.
-o, --output <file> Write output to <file> instead of stdout. If you are using {} or [] to fetch multiple documents, you should quote the URL and you can use '#' followed by a number in the <file> specifier. That variable will be replaced with the current string for the URL being fetched. Like in:
curl "http://{one,two}.example.com" -o "file_#1.txt"
or use several variables like:
curl "http://{site,host}.host[1-5].com" -o "#1_#2"
You may use this option as many times as the number of URLs you have. For example, if you specify two URLs on the same command line, you can use it like this:
curl -o aa example.com -o bb example.net
and the order of the -o options and the URLs does not matter, just that the first -o is for the first URL and so on, so the above command line can also be written as
curl example.com example.net -o aa -o bb
See also the --create-dirs option to create the local directories dynamically. Specifying the output as '-' (a single dash) will force the output to be done to stdout.
To suppress response bodies, you can redirect output to /dev/null:
curl example.com -o /dev/null
Or for Windows use nul:
curl example.com -o nul
Examples: curl -o file https://example.com curl "http://{one,two}.example.com" -o "file_#1.txt" curl "http://{site,host}.host[1-5].com" -o "#1_#2" curl -o file https://example.com -o file2 https://example.net
See also -O, --remote-name, --remote-name-all and -J, --remote- header-name.
--parallel-immediate When doing parallel transfers, this option will instruct curl that it should rather prefer opening up more connections in parallel at once rather than waiting to see if new transfers can be added as multiplexed streams on another connection.
Example: curl --parallel-immediate -Z https://example.com -o file1 https://example.com -o file2
See also -Z, --parallel and --parallel-max. Added in 7.68.0.
--parallel-max <num> When asked to do parallel transfers, using -Z, --parallel, this option controls the maximum amount of transfers to do simultaneously.
The default is 50.
Example: curl --parallel-max 100 -Z https://example.com ftp://example.com/
See also -Z, --parallel. Added in 7.66.0.
-Z, --parallel Makes curl perform its transfers in parallel as compared to the regular serial manner.
Example: curl --parallel https://example.com -o file1 https://example.com -o file2
Added in 7.66.0.
--pass <phrase> (SSH TLS) Passphrase for the private key.
Example: curl --pass secret --key file https://example.com
--path-as-is Tell curl to not handle sequences of /../ or /./ in the given URL path. Normally curl will squash or merge them according to standards but with this option set you tell it not to do that.
Example: curl --path-as-is https://example.com/../../etc/passwd
--pinnedpubkey <hashes> (TLS) Tells curl to use the specified public key file (or hashes) to verify the peer. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by 'sha256//' and separated by ';'.
When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, curl will abort the connection before sending or receiving any data.
PEM/DER support:
7.39.0: OpenSSL, GnuTLS and GSKit
7.43.0: NSS and wolfSSL
7.47.0: mbedtls
sha256 support:
7.44.0: OpenSSL, GnuTLS, NSS and wolfSSL
Other SSL backends not supported.
Examples: curl --pinnedpubkey keyfile https://example.com curl --pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com
Added in 7.39.0.
--post301 (HTTP) Tells curl to respect RFC 7231/6.4.2 and not convert POST requests into GET requests when following a 301 redirection. The non-RFC behavior is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using -L, --location.
Example: curl --post301 --location -d "data" https://example.com
See also --post302, --post303 and -L, --location.
--post302 (HTTP) Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET requests when following a 302 redirection. The non-RFC behavior is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using -L, --location.
Example: curl --post302 --location -d "data" https://example.com
See also --post301, --post303 and -L, --location.
--post303 (HTTP) Tells curl to violate RFC 7231/6.4.4 and not convert POST requests into GET requests when following 303 redirections. A server may require a POST to remain a POST after a 303 redirection. This option is meaningful only when using -L, --location.
Example: curl --post303 --location -d "data" https://example.com
See also --post302, --post301 and -L, --location.
--preproxy [protocol://]host[:port] Use the specified SOCKS proxy before connecting to an HTTP or HTTPS -x, --proxy. In such a case curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy.
The pre proxy string should be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// to request the specific SOCKS version to be used. No protocol specified will make curl default to SOCKS4.
If the port number is not specified in the proxy string, it is assumed to be 1080.
User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in a colon with %3a.
Example: curl --preproxy socks5://proxy.example -x http://http.example https://example.com
-#, --progress-bar Make curl display transfer progress as a simple progress bar instead of the standard, more informational, meter.
This progress bar draws a single line of '#' characters across the screen and shows a percentage if the transfer size is known. For transfers without a known size, there will be space ship (-=o=-) that moves back and forth but only while data is being transferred, with a set of flying hash sign symbols on top.
Example: curl -# -O https://example.com
--proto-default <protocol> Tells curl to use protocol for any URL missing a scheme name.
An unknown or unsupported protocol causes error CURLE_UNSUPPORTED_PROTOCOL (1).
This option does not change the default proxy protocol (http).
Without this option set, curl guesses protocol based on the host name, see --url for details.
Example: curl --proto-default https ftp.example.com
Added in 7.45.0.
--proto-redir <protocols> Tells curl to limit what protocols it may use on redirect. Protocols denied by --proto are not overridden by this option. See --proto for how protocols are represented.
Example, allow only HTTP and HTTPS on redirect:
curl --proto-redir -all,http,https http://example.com
By default curl will only allow HTTP, HTTPS, FTP and FTPS on redirect (since 7.65.2). Specifying all or +all enables all protocols on redirects, which is not good for security.
Example: curl --proto-redir =http,https https://example.com
--proto <protocols> Tells curl to limit what protocols it may use for transfers. Protocols are evaluated left to right, are comma separated, and are each a protocol name or 'all', optionally prefixed by zero or more modifiers. Available modifiers are:
+  Permit this protocol in addition to protocols already permitted (this is the default if no modifier is used).
-  Deny this protocol, removing it from the list of protocols already permitted.
=  Permit only this protocol (ignoring the list already permitted), though subject to later modification by subsequent entries in the comma separated list.
--proto -ftps  uses the default protocols, but disables ftps
--proto -all,https,+http only enables http and https
--proto =http,https also only enables http and https
Unknown protocols produce a warning. This allows scripts to safely rely on being able to disable potentially dangerous protocols, without relying upon support for that protocol being built into curl to avoid an error.
This option can be used multiple times, in which case the effect is the same as concatenating the protocols into one instance of the option.
Example: curl --proto =http,https,sftp https://example.com
See also --proto-redir and --proto-default.
--proxy-anyauth Tells curl to pick a suitable authentication method when communicating with the given HTTP proxy. This might cause an extra request/response round-trip.
Example: curl --proxy-anyauth --proxy-user user:passwd -x proxy https://example.com
See also -x, --proxy, --proxy-basic and --proxy-digest.
--proxy-basic Tells curl to use HTTP Basic authentication when communicating with the given proxy. Use --basic for enabling HTTP Basic with a remote host. Basic is the default authentication method curl uses with proxies.
Example: curl --proxy-basic --proxy-user user:passwd -x proxy https://example.com
See also -x, --proxy, --proxy-anyauth and --proxy-digest.
--proxy-cacert <file> Same as --cacert but used in HTTPS proxy context.
Example: curl --proxy-cacert CA-file.txt -x https://proxy https://example.com
See also --proxy-capath, --cacert, --capath and -x, --proxy. Added in 7.52.0.
--proxy-capath <dir> Same as --capath but used in HTTPS proxy context.
Example: curl --proxy-capath /local/directory -x https://proxy https://example.com
See also --proxy-cacert, -x, --proxy and --capath. Added in 7.52.0.
--proxy-cert-type <type> Same as --cert-type but used in HTTPS proxy context.
Example: curl --proxy-cert-type PEM --proxy-cert file -x https://proxy https://example.com
--proxy-cert <cert[:passwd]> Same as -E, --cert but used in HTTPS proxy context.
Example: curl --proxy-cert file -x https://proxy https://example.com
--proxy-ciphers <list> Same as --ciphers but used in HTTPS proxy context.
Example: curl --proxy-ciphers ECDHE-ECDSA-AES256-CCM8 -x https://proxy https://example.com
--proxy-crlfile <file> Same as --crlfile but used in HTTPS proxy context.
Example: curl --proxy-crlfile rejects.txt -x https://proxy https://example.com
--proxy-digest Tells curl to use HTTP Digest authentication when communicating with the given proxy. Use --digest for enabling HTTP Digest with a remote host.
Example: curl --proxy-digest --proxy-user user:passwd -x proxy https://example.com
See also -x, --proxy, --proxy-anyauth and --proxy-basic.
--proxy-header <header/@file> (HTTP) Extra header to include in the request when sending HTTP to a proxy. You may specify any number of extra headers. This is the equivalent option to -H, --header but is for proxy communication only like in CONNECT requests when you want a separate header sent to the proxy to what is sent to the actual remote host.
Headers specified with this option will not be included in requests that curl knows will not be sent to a proxy.
Starting in 7.55.0, this option can take an argument in @filename style, which then adds a header for each line in the input file. Using @- will make curl read the header file from stdin.
Examples: curl --proxy-header "X-First-Name: Joe" -x http://proxy https://example.com curl --proxy-header "User-Agent: surprise" -x http://proxy https://example.com curl --proxy-header "Host:" -x http://proxy https://example.com
Added in 7.37.0.
--proxy-insecure Same as -k, --insecure but used in HTTPS proxy context.
Example: curl --proxy-insecure -x https://proxy https://example.com
--proxy-key-type <type> Same as --key-type but used in HTTPS proxy context.
Example: curl --proxy-key-type DER --proxy-key here -x https://proxy https://example.com
--proxy-key <key> Same as --key but used in HTTPS proxy context.
Example: curl --proxy-key here -x https://proxy https://example.com
--proxy-negotiate Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating with the given proxy. Use --negotiate for enabling HTTP Negotiate (SPNEGO) with a remote host.
Example: curl --proxy-negotiate --proxy-user user:passwd -x proxy https://example.com
See also --proxy-anyauth and --proxy-basic.
--proxy-ntlm Tells curl to use HTTP NTLM authentication when communicating with the given proxy. Use --ntlm for enabling NTLM with a remote host.
Example: curl --proxy-ntlm --proxy-user user:passwd -x http://proxy https://example.com
See also --proxy-negotiate and --proxy-anyauth.
--proxy-pass <phrase> Same as --pass but used in HTTPS proxy context.
Example: curl --proxy-pass secret --proxy-key here -x https://proxy https://example.com
--proxy-pinnedpubkey <hashes> (TLS) Tells curl to use the specified public key file (or hashes) to verify the proxy. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by 'sha256//' and separated by ';'.
Examples: curl --proxy-pinnedpubkey keyfile https://example.com curl --proxy-pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com
--proxy-service-name <name> This option allows you to change the service name for proxy negotiation.
Example: curl --proxy-service-name "shrubbery" -x proxy https://example.com
Added in 7.43.0.
--proxy-ssl-allow-beast Same as --ssl-allow-beast but used in HTTPS proxy context.
Example: curl --proxy-ssl-allow-beast -x https://proxy https://example.com
--proxy-ssl-auto-client-cert Same as --ssl-auto-client-cert but used in HTTPS proxy context.
Example: curl --proxy-ssl-auto-client-cert -x https://proxy https://example.com
Added in 7.77.0.
--proxy-tls13-ciphers <ciphersuite list> (TLS) Specifies which cipher suites to use in the connection to your HTTPS proxy when it negotiates TLS 1.3. The list of ciphers suites must specify valid ciphers. Read up on TLS 1.3 cipher suite details on this URL:
This option is currently used only when curl is built to use OpenSSL 1.1.1 or later. If you are using a different SSL backend you can try setting TLS 1.3 cipher suites by using the --proxy- ciphers option.
Example: curl --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy https://example.com
Added in 7.61.0.
--proxy-tlsauthtype <type> Same as --tlsauthtype but used in HTTPS proxy context.
Example: curl --proxy-tlsauthtype SRP -x https://proxy https://example.com
--proxy-tlspassword <string> Same as --tlspassword but used in HTTPS proxy context.
Example: curl --proxy-tlspassword passwd -x https://proxy https://example.com
--proxy-tlsuser <name> Same as --tlsuser but used in HTTPS proxy context.
Example: curl --proxy-tlsuser smith -x https://proxy https://example.com
--proxy-tlsv1 Same as -1, --tlsv1 but used in HTTPS proxy context.
Example: curl --proxy-tlsv1 -x https://proxy https://example.com
-U, --proxy-user <user:password> Specify the user name and password to use for proxy authentication.
If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM authentication then you can tell curl to select the user name and password from your environment by specifying a single colon with this option: "-U :".
On systems where it works, curl will hide the given option argument from process listings. This is not enough to protect credentials from possibly getting seen by other users on the same system as they will still be visible for a brief moment before cleared. Such sensitive data should be retrieved from a file instead or similar and never used in clear text in a command line.
Example: curl --proxy-user name:pwd -x proxy https://example.com
-x, --proxy [protocol://]host[:port] Use the specified proxy.
The proxy string can be specified with a protocol:// prefix. No protocol specified or http:// will be treated as HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be used.
HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for OpenSSL, GnuTLS and NSS.
Unrecognized and unsupported proxy protocols cause an error since 7.52.0.  Prior versions may ignore the protocol and use http:// instead.
This option overrides existing environment variables that set the proxy to use. If there's an environment variable setting a proxy, you can set proxy to "" to override it.
All operations that are performed over an HTTP proxy will transparently be converted to HTTP. It means that certain protocol specific operations might not be available. This is not the case if you can tunnel through the proxy, as one with the -p, --proxytunnel option.
The proxy host can be specified the exact same way as the proxy environment variables, including the protocol prefix (http://) and the embedded user + password.
Example: curl --proxy http://proxy.example https://example.com
--proxy1.0 <host[:port]> Use the specified HTTP 1.0 proxy. If the port number is not specified, it is assumed at port 1080.
The only difference between this and the HTTP proxy option -x, --proxy, is that attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol instead of the default HTTP 1.1.
Example: curl --proxy1.0 -x http://proxy https://example.com
-p, --proxytunnel When an HTTP proxy is used -x, --proxy, this option will make curl tunnel through the proxy. The tunnel approach is made with the HTTP proxy CONNECT request and requires that the proxy allows direct connect to the remote port number curl wants to tunnel through to.
To suppress proxy CONNECT response headers when curl is set to output headers use --suppress-connect-headers.
Example: curl --proxytunnel -x http://proxy https://example.com
See also -x, --proxy.
--pubkey <key> (SFTP SCP) Public key file name. Allows you to provide your public key in this separate file.
(As of 7.39.0, curl attempts to automatically extract the public key from the private key file, so passing this option is generally not required. Note that this public key extraction requires libcurl to be linked against a copy of libssh2 1.2.8 or higher that is itself linked against OpenSSL.)
Example: curl --pubkey file.pub sftp://example.com/
-Q, --quote <command> (FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are sent BEFORE the transfer takes place (just after the initial PWD command in an FTP transfer, to be exact). To make commands take place after a successful transfer, prefix them with a dash '-'.  To make commands be sent after curl has changed the working directory, just before the transfer command(s), prefix the command with a '+' (this is only supported for FTP). You may specify any number of commands.
By default curl will stop at first failure. To make curl continue even if the command fails, prefix the command with an asterisk (*). Otherwise, if the server returns failure for one of the commands, the entire operation will be aborted.
You must send syntactically correct FTP commands as RFC 959 defines to FTP servers, or one of the commands listed below to SFTP servers.
SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands itself before sending them to the server.  File names may be quoted shell-style to embed spaces or special characters.  Following is the list of all supported SFTP quote commands:
atime date file The atime command sets the last access time of the file named by the file operand. The <date expression> can be all sorts of date strings, see the curl_getdate(3) man page for date expression details. (Added in 7.73.0)
chgrp group file The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID.
chmod mode file The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number.
chown user file The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID.
ln source_file target_file The ln and symlink commands create a symbolic link at the target_file location pointing to the source_file location.
mkdir directory_name The mkdir command creates the directory named by the directory_name operand.
mtime date file The mtime command sets the last modification time of the file named by the file operand. The <date expression> can be all sorts of date strings, see the curl_getdate(3) man page for date expression details. (Added in 7.73.0)
pwd    The pwd command returns the absolute pathname of the current working directory.
rename source target The rename command renames the file or directory named by the source operand to the destination path named by the target operand.
rm file The rm command removes the file specified by the file operand.
rmdir directory The rmdir command removes the directory entry specified by the directory operand, provided it is empty.
symlink source_file target_file See ln.
Example: curl --quote "DELE file" ftp://example.com/foo
--random-file <file> Specify the path name to file containing what will be considered as random data. The data may be used to seed the random engine for SSL connections.  See also the --egd-file option.
Example: curl --random-file rubbish https://example.com
-r, --range <range> (HTTP FTP SFTP FILE) Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified in a number of ways.
0-499     specifies the first 500 bytes
500-999   specifies the second 500 bytes
-500      specifies the last 500 bytes
9500-     specifies the bytes from offset 9500 and forward
0-0,-1    specifies the first and last byte only(*)(HTTP)
100-199,500-599 specifies two separate 100-byte ranges(*) (HTTP)
(*) = NOTE that this will cause the server to reply with a multipart response, which will be returned as-is by curl! Parsing or otherwise transforming this response is the responsibility of the caller.
Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the 'start-stop' range syntax. If a non-digit character is given in the range, the server's response will be unspecified, depending on the server's configuration.
You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you will instead get the whole document.
FTP and SFTP range downloads only support the simple 'start-stop' syntax (optionally with one of the numbers omitted). FTP use depends on the extended FTP command SIZE.
Example: curl --range 22-44 https://example.com
--raw  (HTTP) When used, it disables all internal HTTP decoding of content or transfer encodings and instead makes them passed on unaltered, raw.
Example: curl --raw https://example.com
-e, --referer <URL> (HTTP) Sends the "Referrer Page" information to the HTTP server. This can also be set with the -H, --header flag of course.  When used with -L, --location you can append ";auto" to the -e, --referer URL to make curl automatically set the previous URL when it follows a Location: header. The ";auto" string can be used alone, even if you do not set an initial -e, --referer.
Examples: curl --referer "https://fake.example" https://example.com curl --referer "https://fake.example;auto" -L https://example.com curl --referer ";auto" -L https://example.com
See also -A, --user-agent and -H, --header.
-J, --remote-header-name (HTTP) This option tells the -O, --remote-name option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL.
If the server specifies a file name and a file with that name already exists in the current working directory it will not be overwritten and an error will occur. If the server does not specify a file name then this option has no effect.
There's no attempt to decode %-sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names.
WARNING: Exercise judicious use of this option, especially on Windows. A rogue server could send you the name of a DLL or other file that could possibly be loaded automatically by Windows or some third party software.
Example: curl -OJ https://example.com/file
--remote-name-all This option changes the default action for all given URLs to be dealt with as if -O, --remote-name were used for each one. So if you want to disable that for a specific URL after --remote-name- all has been used, you must use "-o -" or --no-remote-name.
Example: curl --remote-name-all ftp://example.com/file1 ftp://example.com/file2
-O, --remote-name Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.)
The file will be saved in the current working directory. If you want the file saved in a different directory, make sure you change the current working directory before invoking curl with this option.
The remote file name to use for saving is extracted from the given URL, nothing else, and if it already exists it will be overwritten. If you want the server to be able to choose the file name refer to -J, --remote-header-name which can be used in addition to this option. If the server chooses a file name and that name already exists it will not be overwritten.
There is no URL decoding done on the file name. If it has %20 or other URL encoded parts of the name, they will end up as-is as file name.
You may use this option as many times as the number of URLs you have.
Example: curl -O https://example.com/filename
-R, --remote-time When used, this will make curl attempt to figure out the timestamp of the remote file, and if that is available make the local file get that same timestamp.
Example: curl --remote-time -o foo https://example.com
--request-target <path> (HTTP) Tells curl to use an alternative "target" (path) instead of using the path as provided in the URL. Particularly useful when wanting to issue HTTP requests without leading slash or other data that does not follow the regular URL pattern, like "OPTIONS *".
Example: curl --request-target "*" -X OPTIONS https://example.com
Added in 7.55.0.
-X, --request <command> (HTTP) Specifies a custom request method to use when communicating with the HTTP server.  The specified request method will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more.
Normally you do not need this option. All sorts of GET, HEAD, POST and PUT requests are rather invoked by using dedicated command line options.
This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. So for example if you want to make a proper HEAD request, using -X HEAD will not suffice. You need to use the -I, --head option.
The method string you set with -X, --request will be used for all requests, which if you for example use -L, --location may cause unintended side-effects when curl does not change request method according to the HTTP 30x response codes - and similar.
(FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP.
(POP3) Specifies a custom POP3 command to use instead of LIST or RETR.
(IMAP) Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0)
(SMTP) Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)
Examples: curl -X "DELETE" https://example.com curl -X NLST ftp://example.com/
--resolve <[+]host:port:addr[,addr]...> Provide a custom address for a specific host and port pair. Using this, you can make the curl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line. The port number should be the number used for the specific protocol the host will be used for. It means you need several entries if you want to provide address for the same host but different ports.
By specifying '*' as host you can tell curl to resolve any host and specific port pair to the specified address. Wildcard is resolved last so any --resolve with a specific host and port will be used first.
The provided address set by this option will be used even if -4, --ipv4 or -6, --ipv6 is set to make curl use another IP version.
By prefixing the host with a '+' you can make the entry time out after curl's default timeout (1 minute). Note that this will only make sense for long running parallel transfers with a lot of files. In such cases, if this option is used curl will try to resolve the host as it normally would once the timeout has expired.
Support for providing the IP address within [brackets] was added in 7.57.0.
Support for providing multiple IP addresses per entry was added in 7.59.0.
Support for resolving with wildcard was added in 7.64.0.
Support for the '+' prefix was was added in 7.75.0.
This option can be used many times to add many host names to resolve.
Example: curl --resolve example.com:443:127.0.0.1 https://example.com
--retry-all-errors Retry on any error. This option is used together with --retry.
This option is the "sledgehammer" of retrying. Do not use this option by default (eg in curlrc), there may be unintended consequences such as sending or receiving duplicate data. Do not use with redirected input or output. You'd be much better off handling your unique problems in shell script. Please read the example below.
WARNING: For server compatibility curl attempts to retry failed flaky transfers as close as possible to how they were started, but this is not possible with redirected input or output. For example, before retrying it removes output data from a failed partial transfer that was written to an output file. However this is not true of data redirected to a | pipe or > file, which are not reset. We strongly suggest you do not parse or record output via redirect in combination with this option, since you may receive duplicate data.
By default curl will not error on an HTTP response code that indicates an HTTP error, if the transfer was successful. For example, if a server replies 404 Not Found and the reply is fully received then that is not an error. When --retry is used then curl will retry on some HTTP response codes that indicate transient HTTP errors, but that does not include most 4xx response codes such as 404. If you want to retry on all response codes that indicate HTTP errors (4xx and 5xx) then combine with -f, --fail.
Example: curl --retry-all-errors https://example.com
Added in 7.71.0.
--retry-connrefused In addition to the other conditions, consider ECONNREFUSED as a transient error too for --retry. This option is used together with --retry.
Example: curl --retry-connrefused --retry https://example.com
--retry-delay <seconds> Make curl sleep this amount of time before each retry when a transfer has failed with a transient error (it changes the default backoff time algorithm between retries). This option is only interesting if --retry is also used. Setting this delay to zero will make curl use the default backoff time.
Example: curl --retry-delay 5 --retry https://example.com
--retry-max-time <seconds> The retry timer is reset before the first transfer attempt. Retries will be done as usual (see --retry) as long as the timer has not reached this given limit. Notice that if the timer has not reached the limit, the request will be made and while performing, it may take longer than this given time period. To limit a single request's maximum time, use -m, --max-time.  Set this option to zero to not timeout retries.
Example: curl --retry-max-time 30 --retry 10 https://example.com
--retry <num> If a transient error is returned when curl tries to perform a transfer, it will retry this number of times before giving up. Setting the number to 0 makes curl do no retries (which is the default). Transient error means either: a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504 response code.
When curl is about to retry a transfer, it will first wait one second and then for all forthcoming retries it will double the waiting time until it reaches 10 minutes which then will be the delay between the rest of the retries.  By using --retry-delay you disable this exponential backoff algorithm. See also --retry-max- time to limit the total time allowed for retries.
Since curl 7.66.0, curl will comply with the Retry-After: response header if one was present to know when to issue the next retry.
Example: curl --retry 7 https://example.com
--sasl-authzid <identity> Use this authorisation identity (authzid), during SASL PLAIN authentication, in addition to the authentication identity (authcid) as specified by -u, --user.
If the option is not specified, the server will derive the authzid from the authcid, but if specified, and depending on the server implementation, it may be used to access another user's inbox, that the user has been granted access to, or a shared mailbox for example.
Example: curl --sasl-authzid zid imap://example.com/
--sasl-ir Enable initial response in SASL authentication.
Example: curl --sasl-ir imap://example.com/
Added in 7.31.0.
--service-name <name> This option allows you to change the service name for SPNEGO.
Examples: --negotiate --service-name sockd would use sockd/server- name.
Example: curl --service-name sockd/server https://example.com
-S, --show-error When used with -s, --silent, it makes curl show an error message if it fails.
Example: curl --show-error --silent https://example.com
See also --no-progress-meter.
-s, --silent Silent or quiet mode. Do not show progress meter or error messages.  Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.
Use -S, --show-error in addition to this option to disable progress meter but still show error messages.
Example: curl -s https://example.com
See also -v, --verbose, --stderr and --no-progress-meter.
--socks4 <host[:port]> Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. Using this socket type make curl resolve the host name and passing the address on to the proxy.
This option overrides any previous use of -x, --proxy, as they are mutually exclusive.
This option is superfluous since you can specify a socks4 proxy with -x, --proxy using a socks4:// protocol prefix.
Since 7.52.0, --preproxy can be used to specify a SOCKS proxy at the same time -x, --proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
Example: curl --socks4 hostname:4096 https://example.com
--socks4a <host[:port]> Use the specified SOCKS4a proxy. If the port number is not specified, it is assumed at port 1080. This asks the proxy to resolve the host name.
This option is superfluous since you can specify a socks4a proxy with -x, --proxy using a socks4a:// protocol prefix.
Example: curl --socks4a hostname:4096 https://example.com
--socks5-basic Tells curl to use username/password authentication when connecting to a SOCKS5 proxy.  The username/password authentication is enabled by default.  Use --socks5-gssapi to force GSS-API authentication to SOCKS5 proxies.
Example: curl --socks5-basic --socks5 hostname:4096 https://example.com
--socks5-gssapi-nec As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961 says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not.  The option --socks5-gssapi-nec allows the unprotected exchange of the protection mode negotiation.
Example: curl --socks5-gssapi-nec --socks5 hostname:4096 https://example.com
--socks5-gssapi-service <name> The default service name for a socks server is rcmd/server-fqdn. This option allows you to change it.
Examples: --socks5 proxy-name --socks5-gssapi-service sockd would use sockd/proxy-name --socks5 proxy-name --socks5-gssapi-service sockd/real-name would use sockd/real-name for cases where the proxy-name does not match the principal name.
Example: curl --socks5-gssapi-service sockd --socks5 hostname:4096 https://example.com
--socks5-gssapi Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy.  The GSS-API authentication is enabled by default (if curl is compiled with GSS-API support).  Use --socks5-basic to force username/password authentication to SOCKS5 proxies.
Example: curl --socks5-gssapi --socks5 hostname:4096 https://example.com
--socks5-hostname <host[:port]> Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If the port number is not specified, it is assumed at port 1080.
This option is superfluous since you can specify a socks5 hostname proxy with -x, --proxy using a socks5h:// protocol prefix.
Example: curl --socks5-hostname proxy.example:7000 https://example.com
--socks5 <host[:port]> Use the specified SOCKS5 proxy - but resolve the host name locally. If the port number is not specified, it is assumed at port 1080.
This option is superfluous since you can specify a socks5 proxy with -x, --proxy using a socks5:// protocol prefix.
This option (as well as --socks4) does not work with IPV6, FTPS or LDAP.
Example: curl --socks5 proxy.example:7000 https://example.com
-Y, --speed-limit <speed> If a download is slower than this given speed (in bytes per second) for speed-time seconds it gets aborted. speed-time is set with -y, --speed-time and is 30 if not set.
Example: curl --speed-limit 300 --speed-time 10 https://example.com
-y, --speed-time <seconds> If a download is slower than speed-limit bytes per second during a speed-time period, the download gets aborted. If speed-time is used, the default speed-limit will be 1 unless set with -Y, --speed-limit.
This option controls transfers and thus will not affect slow connects etc. If this is a concern for you, try the --connect- timeout option.
--ssl-allow-beast This option tells curl to not work around a security flaw in the SSL3 and TLS1.0 protocols known as BEAST.  If this option is not used, the SSL layer may use workarounds known to cause interoperability problems with some older SSL implementations.
WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that.
Example: curl --ssl-allow-beast https://example.com
--ssl-auto-client-cert Tell libcurl to automatically locate and use a client certificate for authentication, when requested by the server. This option is only supported for Schannel (the native Windows SSL library). Prior to 7.77.0 this was the default behavior in libcurl with Schannel. Since the server can request any certificate that supports client authentication in the OS certificate store it could be a privacy violation and unexpected.
Example: curl --ssl-auto-client-cert https://example.com
See also --proxy-ssl-auto-client-cert. Added in 7.77.0.
--ssl-no-revoke (Schannel) This option tells curl to disable certificate revocation checks.  WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that.
Example: curl --ssl-no-revoke https://example.com
Added in 7.44.0.
--ssl-reqd (FTP IMAP POP3 SMTP) Require SSL/TLS for the connection. Terminates the connection if the server does not support SSL/TLS.
This option was formerly known as --ftp-ssl-reqd.
Example: curl --ssl-reqd ftp://example.com
--ssl-revoke-best-effort (Schannel) This option tells curl to ignore certificate revocation checks when they failed due to missing/offline distribution points for the revocation check lists.
Example: curl --ssl-revoke-best-effort https://example.com
Added in 7.70.0.
--ssl  (FTP IMAP POP3 SMTP) Try to use SSL/TLS for the connection. Reverts to a non-secure connection if the server does not support SSL/TLS.  See also --ftp-ssl-control and --ssl-reqd for different levels of encryption required.
This option was formerly known as --ftp-ssl. That option name can still be used but will be removed in a future version.
Example: curl --ssl pop3://example.com/
-2, --sslv2 (SSL) This option previously asked curl to use SSLv2, but starting in curl 7.77.0 this instruction is ignored. SSLv2 is widely considered insecure (see RFC 6176).
Example: curl --sslv2 https://example.com
See also --http1.1 and --http2. -2, --sslv2 requires that the underlying libcurl was built to support TLS. This option overrides -3, --sslv3 and -1, --tlsv1 and --tlsv1.1 and --tlsv1.2.
-3, --sslv3 (SSL) This option previously asked curl to use SSLv3, but starting in curl 7.77.0 this instruction is ignored. SSLv3 is widely considered insecure (see RFC 7568).
Example: curl --sslv3 https://example.com
See also --http1.1 and --http2. -3, --sslv3 requires that the underlying libcurl was built to support TLS. This option overrides -2, --sslv2 and -1, --tlsv1 and --tlsv1.1 and --tlsv1.2.
--stderr <file> Redirect all writes to stderr to the specified file instead. If the file name is a plain '-', it is instead written to stdout.
Example: curl --stderr output.txt https://example.com
See also -v, --verbose and -s, --silent.
--styled-output Enables the automatic use of bold font styles when writing HTTP headers to the terminal. Use --no-styled-output to switch them off.
Example: curl --styled-output -I https://example.com
--suppress-connect-headers When -p, --proxytunnel is used and a CONNECT request is made do not output proxy CONNECT response headers. This option is meant to be used with -D, --dump-header or -i, --include which are used to show protocol headers in the output. It has no effect on debug options such as -v, --verbose or --trace, or any statistics.
Example: curl --suppress-connect-headers --include -x proxy https://example.com
See also -D, --dump-header, -i, --include and -p, --proxytunnel. Added in 7.54.0.
--tcp-fastopen Enable use of TCP Fast Open (RFC7413).
Example: curl --tcp-fastopen https://example.com
Added in 7.49.0.
--tcp-nodelay Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man page for details about this option.
Since 7.50.2, curl sets this option by default and you need to explicitly switch it off if you do not want it on.
Example: curl --tcp-nodelay https://example.com
-t, --telnet-option <opt=val> Pass options to the telnet protocol. Supported options are:
TTYPE=<term> Sets the terminal type.
XDISPLOC=<X display> Sets the X display location.
NEW_ENV=<var,val> Sets an environment variable.
Example: curl -t TTYPE=vt100 telnet://example.com/
--tftp-blksize <value> (TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will try to use when transferring data to or from a TFTP server. By default 512 bytes will be used.
Example: curl --tftp-blksize 1024 tftp://example.com/file
--tftp-no-options (TFTP) Tells curl not to send TFTP options requests.
This option improves interop with some legacy servers that do not acknowledge or properly implement TFTP options. When this option is used --tftp-blksize is ignored.
Example: curl --tftp-no-options tftp://192.168.0.1/
Added in 7.48.0.