You are on page 1of 31

curl(1

)

Curl Manual

curl(1)

NAME
curl − transfer a URL

SYNOPSIS
curl [options] [URL...]

DESCRIPTION
curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction. curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more. As you will see below, the number of features will make your head spin! curl is powered by libcurl for all transfer-related features. See libcurl(3) for details.

URL
The URL syntax is protocol-dependent. You’ll find a detailed description in RFC 3986. You can specify multiple URLs or parts of URLs by writing part sets within braces as in: http://site.{one,two,three}.com or you can get sequences of alphanumeric series by using [] as in: ftp://ftp.numericals.com/file[1-100].txt ftp://ftp.numericals.com/file[001-100].txt ftp://ftp.letters.com/file[a-z].txt

(with leading zeros)

Nested sequences are not supported, but you can use several ones next to each other: http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html You can specify any amount of URLs on the command line. They will be fetched in a sequential manner in the specified order. You can specify a step counter for the ranges to get every Nth number or letter: http://www.numericals.com/file[1-100:10].txt http://www.letters.com/file[a-z:2].txt If you specify URL without protocol:// prefix, curl will attempt to guess what protocol you might want. It will then default to HTTP but try other protocols based on often-used host name prefixes. For example, for host names starting with "ftp." curl will assume you want to speak FTP. curl will do its best to use what you pass to it as a URL. It is not trying to validate it as a syntactically correct URL by any means but is instead very liberal with what it accepts. curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple connects / handshakes. This improves speed. Of course this is only done on files specified on a single command line and cannot be used between separate curl invokes.

PROGRESS METER
curl normally displays a progress meter during operations, indicating the amount of transferred data, transfer speeds and estimated time left, etc.

Curl 7.27.0

27 July 2012

1

curl(1)

Curl Manual

curl(1)

curl displays this data to the terminal by default, so if you invoke curl to do an operation and it is about to write data to the terminal, it disables the progress meter as otherwise it would mess up the output mixing progress meter and response data. If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, using shell redirect (>), -o [file] or similar. It is not the same case for FTP upload as that operation does not spit out any response data to the terminal. If you prefer a progress "bar" instead of the regular meter, -# is your friend.

OPTIONS
In general, all boolean options are enabled with --option and yet again disabled with --no-option. That is, you use the exact same option name but prefix it with "no-". However, in this list we mostly only list and show the --option version of them. (This concept with --no options was added in 7.19.0. Previously most options were toggled on/off on repeated use of the same command line option.) -#, --progress-bar Make curl display progress as a simple progress bar instead of the standard, more informational, meter. -0, --http1.0 (HTTP) Forces curl to issue its requests using HTTP 1.0 instead of using its internally preferred: HTTP 1.1. -1, --tlsv1 (SSL) Forces curl to use TLS version 1 when negotiating with a remote TLS server. -2, --sslv2 (SSL) Forces curl to use SSL version 2 when negotiating with a remote SSL server. -3, --sslv3 (SSL) Forces curl to use SSL version 3 when negotiating with a remote SSL server. -4, --ipv4 If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv4 addresses only. -6, --ipv6 If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv6 addresses only. -a, --append (FTP/SFTP) When used in an upload, this will tell curl to append to the target file instead of overwriting it. If the file doesn’t exist, it will be created. Note that this flag is ignored by some SSH servers (including OpenSSH). -A, --user-agent <agent string> (HTTP) Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if this field isn’t set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks. This can also be set with the -H, --header option of course. If this option is used several times, the last one will be used. --anyauth (HTTP) Tells curl to figure out authentication method by itself, and use the most secure one the remote site claims to support. This is done by first doing a request and checking the responseheaders, thus possibly inducing an extra network round-trip. This is used instead of setting a specific authentication method, which you can do with --basic, --digest, --ntlm, and --negotiate. Note that using --anyauth is not recommended if you do uploads from stdin, since it may require

Curl 7.27.0

27 July 2012

2

curl(1)

Curl Manual

curl(1)

data to be sent twice and then the client must be able to rewind. If the need should arise when uploading from stdin, the upload operation will fail. -b, --cookie <name=data> (HTTP) Pass the data to the HTTP server as a cookie. It is supposedly the data previously received from the server in a "Set-Cookie:" line. The data should be in the format "NAME1=VALUE1; NAME2=VALUE2". If no ’=’ symbol is used in the line, it is treated as a filename to use to read previously stored cookie lines from, which should be used in this session if they match. Using this method also activates the "cookie parser" which will make curl record incoming cookies too, which may be handy if you’re using this in combination with the -L, --location option. The file format of the file to read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie file format. NOTE that the file specified with -b, --cookie is only used as input. No cookies will be stored in the file. To store cookies, use the -c, --cookie-jar option or you could even save the HTTP headers to a file using -D, --dump-header! If this option is used several times, the last one will be used. -B, --use-ascii (FTP/LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using an URL that ends with ";type=A". This option causes data sent to stdout to be in text mode for win32 systems. --basic (HTTP) Tells curl to use HTTP Basic authentication. This is the default and this option is usually pointless, unless you use it to override a previously set option that sets a different authentication method (such as --ntlm, --digest, or --negotiate). -c, --cookie-jar <file name> (HTTP) Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies previously read from a specified file as well as all cookies received from remote server(s). If no cookies are known, no file will be written. The file will be written using the Netscape cookie file format. If you set the file name to a single dash, "-", the cookies will be written to stdout. This command line option will activate the cookie engine that makes curl record and use cookies. Another way to activate it is to use the -b, --cookie option. If the cookie jar can’t be created or written to, the whole curl operation won’t fail or even report an error clearly. Using -v will get a warning displayed, but that is the only visible feedback you get about this possibly lethal situation. If this option is used several times, the last specified file name will be used. -C, --continue-at <offset> Continue/Resume a previous file transfer at the given offset. The given offset is the exact number of bytes that will be skipped, counting from the beginning of the source file before it is transferred to the destination. If used with uploads, the FTP server command SIZE will not be used by curl. Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out. If this option is used several times, the last one will be used. --ciphers <list of ciphers> (SSL) Specifies which ciphers to use in the connection. The list of ciphers must specify valid ciphers. Read up on SSL cipher list details on this URL: http://www.openssl.org/docs/apps/ciphers.html

Curl 7.27.0

27 July 2012

3

0 27 July 2012 4 . Useful for MVS (OS/390). --cookie option! The -c. --cookie-jar option is however a better way to store cookies. The contents of the file must already be URL-encoded. Thus. To create remote directories when using FTP or SFTP. The full list of NSS ciphers is in the NSSCipherSuite entry at this URL: http://git. This only limits the connection phase. or . nothing else.org/cgit/mod_nss.if you want curl to read the data from stdin.git/plain/docs/mod_nss. To URL-encode the value of a form field you may use --data-urlencode. once curl has connected this option is of no more use. If this option is used and the server sends an unsupported encoding. the last one will be used. --crlfile <file> (HTTPS/FTPS) Provide a file using PEM format with a Certificate Revocation List that may specify peer certificates that are to be considered revoked. --compressed (HTTP) Request a compressed response using one of the algorithms curl supports. Curl 7. This option creates the dirs mentioned with the -o option. --dump-header <file> Write the protocol headers to the specified file. using ’-d name=daniel -d skill=lousy’ would generate a post chunk that looks like ’name=daniel&skill=lousy’. --form. Compare to -F. the last one will be used. If you start the data with the letter @.curl(1) Curl Manual curl(1) NSS ciphers are done differently than OpenSSL and GnuTLS. --create-dirs When used in conjunction with the -o option. --maxtime option. in the same way that a browser does when a user has filled in an HTML form and presses the submit button. the rest should be a file name to read the data from.7) -d. curl will report an error. --connect-timeout <seconds> Maximum time in seconds that you allow the connection to the server to take. If the -o file name uses no dir or if the dirs it mentions already exist. If this option is used several times. To post data purely binary. --data <data> (HTTP) Sends the specified data in a POST request to the HTTP server. Multiple files can also be specified.html#Directives If this option is used several times. Posting data from a file named ’foobar’ would thus be done with --data @foobar. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. -D. Cookies from the headers could then be read in a second curl invocation by using the -b.27. (Added in 7. This option is handy to use when you want to store the headers that an HTTP site sends to you. try --ftp-create-dirs.fedorahosted. See also the -m. --crlf (FTP) Convert LF to CRLF in upload. If this option is used several times. the data pieces specified will be merged together with a separating &-symbol. -d. and save the uncompressed document. the last one will be used. no dir will be created. --data is the same as --data-ascii. If any of these options is used more than once on the same command line. curl will create the necessary local directory hierarchy as needed.19. you should instead use the --databinary option.

If this option is used several times. --delegation LEVEL Set LEVEL to tell the server what it is allowed to delegate when it comes to user credentials. --data-ascii <data> See -d. always Unconditionally allow the server to delegate. --user option to set user name and password.curl(1) Curl Manual curl(1) When used in FTP. the FTP server response lines are considered being "headers" and thus are saved there. name=content This will make curl URL-encode the content part and pass that on. --negotiate and --anyauth for related options. Use this in combination with the normal -u. as that will then make the syntax match one of the other cases below! =content This will make curl URL-encode the content and pass that on. Note that the name is expected to be URL-encoded already. The name part gets an equal sign appended.27.18. resulting in name=urlencoded-file-content. The preceding = symbol is not included in the data. --data-binary <data> (HTTP) This posts data exactly as specified with no extra processing whatsoever. Used with GSS/kerberos. This is an authentication scheme that prevents the password from being sent over the wire in clear text. --data. --data-urlencode <data> (HTTP) This posts data. URL-encode that data and pass it on in the POST. except that newlines are preserved and conversions are never done. the ones following the first will append data as described in -d. --data. Note that the name part is expected to be URL-encoded already. Just be careful so that the content doesn’t contain any = or @ symbols. The <data> part can be passed to curl using one of the following syntaxes: content This will make curl URL-encode the content and pass that on. See also --ntlm. Curl 7. --digest (HTTP) Enables HTTP Digest authentication. none policy Don’t allow any delegation.0) To be CGI-compliant. If you start the data with the letter @. @filename This will make curl load data from the given file (including any newlines). the <data> part should begin with a name followed by a separator and a content specification. similar to the other --data options with the exception that this performs URL-encoding. Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos service ticket. If this option is used several times. which is a matter of realm policy. Data is posted in a similar manner as --data-ascii does. the rest should be a filename. URL-encode that data and pass it on in the POST. name@filename This will make curl load data from the given file (including any newlines).0 27 July 2012 5 . (Added in 7. the last one will be used.

--eprt can be used to explicitly enable EPRT again and --no-eprt is an alias for --disable-eprt. --header flag of course.so) is available then PEM files may be loaded.0 27 July 2012 6 . If the optional password isn’t specified. --engine <name> Select the OpenSSL crypto engine to use for cipher operations. even if you don’t set an initial --referer. using the names the -w option supports. Curl will normally always first attempt to use EPSV before PASV. The socket is used to seed the random engine for SSL connections. Note that this option assumes a "certificate" file that is the private key and the private certificate concatenated! See --cert and --key to specify them independently. --disable-epsv (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP transfers. to allow easier extraction of useful information after having run curl. but with this option. but they enable more functionality in a better way than the traditional PORT command. EPRT and LPRT are extensions to the original FTP protocol. --ftp-port or force it with --ftp-pasv. --ftp-port. If you want to switch to active mode you need to use -P. This can also be set with the -H. --epsv can be used to explicitly enable EPSV again and --no-epsv is an alias for --disable-epsv. the last one will be used. When used with -L. in order to avoid confusion with a nickname. If the NSS PEM PKCS#11 module (libnsspem. and may not work on all servers.27. --disable-eprt (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active FTP transfers. If this option is used several times. Use --engine list to print a list of build-time supported engines./" prefix. --referer <URL> (HTTP) Sends the "Referer Page" information to the HTTP server. Curl 7. See also the --random-file option. If you want to use a file from the current directory. --location you can append ". If curl is built against the NSS SSL library then this option can tell curl the nickname of the certificate to use within the NSS database defined by the environment variable SSL_DIR (or by default /etc/pki/nssdb). -e.auto" to the --referer URL to make curl automatically set the previous URL when it follows a Location: header. please precede it with ". The ". Curl will normally always first attempt to use EPRT. Disabling EPSV only changes the passive behavior. Note that not all (or none) of the engines may be available at runtime. The certificate must be in PEM format. FTPS or another SSL-based protocol. it will be queried for on the terminal. it will not try using EPSV. If this option is used several times.auto" string can be used alone. --cert <certificate[:password]> (SSL) Tells curl to use the specified client certificate file when getting a file with HTTPS. but with this option. the last one will be used. Disabling EPRT only changes the active behavior. --egd-file <file> (SSL) Specify the path name to the Entropy Gathering Daemon socket. only the first one is used. it will use PORT right away. then LPRT before using PORT. If you want to switch to passive mode you need to not use -P. --environment (RISC OS ONLY) Sets a range of environment variables.curl(1) Curl Manual curl(1) If this option is used several times. -E.

27. especially when authentication is involved (response codes 401 and 407). If this option is used several times. --cacert <CA certificate> (SSL) Tells curl to use the specified certificate file to verify the peer. PEM is assumed. PEM. The windows version of curl will automatically look for a CA certs file named ´curl-ca-bundle. or in the Current Working Directory.crt´. DER and ENG are recognized types. If this option is used several times. while the < makes a text field and just get the contents for that text field from a file. either in the same directory as curl.exe. the directory must have been processed using the c_rehash utility supplied with OpenSSL. to send your password file to the server. If this option is set. -f. the default capath value will be ignored. --fail (HTTP) Fail silently (no output at all) on server errors. This method is not fail-safe and there are occasions where non-successful response codes will slip through. This goes for both @ and < Curl 7. the last one will be used. Using --capath can allow OpenSSL-powered curl to make SSL-connections much more efficiently than using --cacert if the --cacert file contains many CA certificates. and if curl is built against OpenSSL. and uses the given path as a path to a CA cert bundle. The difference between @ and < is then that @ makes a file get attached in the post as a file upload. use . curl recognizes the environment variable named ’CURL_CA_BUNDLE’ if it is set. This is mostly done to better enable scripts etc to better deal with failed attempts. --form <name=content> (HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit button.com To read content from stdin instead of a file. If curl is built against the NSS SSL library. This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388. Multiple paths can be provided by separating them with ":" (e. and if it is used several times. Example.g. To just get the content part from a file. "path1:path2:path3"). Normally curl is built to use a default file for this. or in any folder along your PATH.as the filename. If not specified.so) needs to be available for this option to work properly. so this option is typically used to alter that default file. where ’password’ is the name of the form-field to which /etc/passwd will be the input: curl -F password=@/etc/passwd www. This option overrides that variable.mypasswords. The certificates must be in PEM format. This flag will prevent curl from outputting that and return error 22. prefix the file name with an @ sign. the last one will be used. To force the ’content’ part to be a file. This enables uploading of binary files etc. the NSS PEM PKCS#11 module (libnsspem. The certificate(s) must be in PEM format. --capath <CA certificate directory> (SSL) Tells curl to use the specified certificate directory to verify the peer. the last one will be used. In normal cases when an HTTP server fails to deliver a document.0 27 July 2012 7 . -F. it returns an HTML document stating so (which often also describes why and more). prefix the file name with the symbol <.curl(1) Curl Manual curl(1) --cert-type <type> (SSL) Tells curl what certificate type the provided certificate is in. The file may contain multiple CA certificates.

filename="nameinpost"’ url. You can also tell curl what Content-Type to use by using ’type=’. RETR. The method argument should be one of the following alternatives: multicwd curl does a single CWD operation for each path part in the given URL.com or curl -F "name=daniel. --ftp-account [data] (FTP) When an FTP server asks for "account data" after user name and password has been provided.html. For deep hierarchies this means very many commands.filename=nameinpost" url. Curl 7.com You can also explicitly change the name field of a file upload part by setting filename=. using "SITE AUTH" will tell the server to retrieve the username from the certificate.15.filename=\"nameinpost\"" url. send this command. it must be quoted by double-quotes like: curl -F "file=@\"localfile\".5) --ftp-create-dirs (FTP/SFTP) When an FTP or SFTP URL/operation uses a path that doesn’t currently exist on the server.com or curl -F ’file=@"localfile".com If filename/path contains ’. STOR etc and give a full path to the server for all these commands. Using this option.13. When connecting to Tumbleweed’s Secure Transport server over FTPS using a client certificate. in a manner similar to: curl -F "web=@index. curl will do SIZE.’ or ’. the last one will be used. This option can be used multiple times. This is the default but the slowest behavior. --ftp-alternative-to-user <command> (FTP) If authenticating with the USER and PASS commands fails. curl will instead attempt to create missing directories.curl(1) Curl Manual curl(1) constructs. the standard behavior of curl is to fail.type=text/foo" url. This is how RFC 1738 says it should be done. This is the fastest behavior.type=text/html" url. any double-quote or backslash within the filename must be escaped by backslash. --ftp-method [method] (FTP) Control what method curl should use to reach a file on an FTP(S) server.0 27 July 2012 8 .27. See further examples and details in the MANUAL. like this: curl -F "file=@localfile. nocwd curl does no CWD at all.0) If this option is used several times. (Added in 7.’. this data is sent off using the ACCT command.com Note that if a filename/path is quoted by double-quotes. (Added in 7.

27.1) --ftp-pasv (FTP) Use passive mode for the data connection.20. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. When you set this option.type=’ string in the value have no special meaning. --ftp-skip-pasv-ip (FTP) Tell curl to not use the IP address the server suggests in its response to curl’s PASV command when curl connects the data connection. Certain FTP servers. only the first one is used. and the ’. The data will be Curl 7. you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. This is somewhat more standards compliant than ’nocwd’ but without the full penalty of ’multicwd’. The active mode initiates the shutdown and waits for a reply from the server.11. this option will make all data specified with -d.16. -G. --ftp-port again.0) that can still be used but will be removed in a future version. Undoing an enforced passive really isn’t doable but you must then instead enforce the correct -P. require this non-standard command for directory listings as well as up and downloads in PASV mode.0) If this option is used several times. (Added in 7. See --ftp-ssl-ccc-mode for other modes. and will not reply to the shutdown from the server. Passive mode means that curl will try the EPSV command first and then PASV. but instead wait for the server to do it. (Added in 7. clear for transfer.curl(1) Curl Manual curl(1) singlecwd curl does one CWD with the full target directory and then operates on the file "normally" (like in the multicwd case). The default mode is passive. mainly drftpd. but non-encrypted data transfers for efficiency. --data or --data-binary to be used in an HTTP GET request instead of the POST request that otherwise would be used. but using this option can be used to override a previous -P/-ftp-port option. This allows NAT routers to follow the FTP transaction.16.1) --ftp-ssl-ccc-mode [active/passive] (FTP) Use CCC (Clear Command Channel) Sets the CCC mode. (Added in 7. The rest of the control channel communication will be unencrypted. -g.15. --ftp-pret (FTP) Tell curl to send a PRET command before PASV (and EPSV). (Added in 7. Passive is the internal default behavior.2) This option has no effect if PORT.2) --ftp-ssl-control (FTP) Require SSL/TLS for the FTP login. EPRT or EPSV is used instead of PASV. (Added in 7. Allows secure authentication. Use this in preference to --form if there’s any possibility that the string value may accidentally trigger the ’@’ or ’<’ features of --form. The passive mode will not initiate the shutdown.16.14. Leading ’@’ and ’<’ characters.x) --ftp-ssl-ccc (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after authenticating.0 27 July 2012 9 . --get When used. (Added in 7. Instead curl will re-use the same IP address it already uses for the control connection. Fails the transfer if the server doesn’t support SSL/TLS. --globoff This option switches off the "URL globbing parser". unless --disableepsv is used. (Added in 7. --form-string <name=string> (HTTP) Similar to --form except that the value string for the named parameter is used literally.

Curl 7. (Added in 7.. curl will refuse the connection with the host unless the md5sums match. If used in combination with -I. only the first one is used. the POST data will instead be appended to the URL with a HEAD request.x. HTTP-version and more. such as −H "XCustom-Header. --include (HTTP) Include the HTTP-header in the output. you should thus not add that as a part of the header content: do not add newlines or carriage returns.com/ If this option is used several times. --header <header> (HTTP) Extra header to use when getting a web page.1) --ignore-content-length (HTTP) Ignore the Content-Length header. If this option is used several times. curl displays the file size and last modification time only. --interface <name> Perform an operation using a specified interface. Typical browsers always discard session cookies when they’re closed down. This allows you to make even trickier stuff than curl would normally do. You may specify any number of extra headers. --junk-session-cookies (HTTP) When curl is told to read cookies from a given file. -j. date of the document. This option can be used multiple times to add/replace/remove multiple headers. -i. your externally set header will be used instead of the internal one. The string should be the 128 bit MD5 checksum of the remote host’s public key. --hostpubmd5 <md5> (SCP/SFTP) Pass a string containing 32 hexadecimal digits. An example could look like: curl --interface eth0:1 http://www." to send "X-Custom-Header:". The HTTP-header includes things like servername. they will only mess things up for you. If you send the custom header with no-value then its header must be terminated with a semicolon. When used on an FTP or FILE file. which will report incorrect Content-Length for files larger than 2 gigabytes. --user-agent and -e. curl will make sure that each header you add/replace is sent with the proper end-of-line marker. the last one will be used.. This is particularly useful for servers running Apache 1. --referer options. See also the -A.0 27 July 2012 10 . as in: -H "Host:". -I. Remove an internal header by giving a replacement without content on the right side of the colon. --head (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. IP address or host name.27. You can enter interface name. -H. This is because undoing a GET doesn’t make sense. This will basically have the same effect as if a new session is started. this option will make it discard all "session cookies". but you should then instead enforce the alternative method you prefer.curl(1) Curl Manual curl(1) appended to the URL with a ’?’ separator. You should not replace internally set headers without knowing perfectly well what you’re doing.netscape.17. Note that if you should add a custom header that has the same name as one of the internal ones curl would use.

# --. \t. If the first column of a config line is a ’#’ character. if there is no _curlrc file in the home dir. --insecure (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers.0" # and fetch another URL too url = "curl. \". If the parameter is to contain whitespace.se/docs/sslcerts. See this online resource for further details: http://curl.curlrc from the determined home dir. it uses getpwuid() on UNIX-like systems (which returns the home dir given the current user in your system). Only write one option per physical line in the config file.html" user-agent = "superagent/1. So. the preferred separator is the equals sign). Specify the filename to -K. it checks for one in the same dir the curl executable is placed.haxx. Failing that. it could look similar to this: url = "http://curl. --remote-header-name (HTTP) This option tells the -O. the rest of the line will be treated as a comment. you need to specify it using the --url option. the parameter must be enclosed within quotes. On UNIX-like systems. --remote-name option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL.haxx. colon. -k. --config as ’-’ to make curl read the file from stdin. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. it then checks for the APPDATA variable. Options and their parameters must be specified on the same config file line.se/docs/" Long option names can optionally be given in the config file without the initial double dashes. This makes all connections considered "insecure" fail unless -k.haxx.html" -O referer = "http://nowhereatall. and not by simply writing the URL on its own line. 2) On windows. The config file is a text file in which command line arguments can be written which then will be used as if they were written on the actual command line. \n. On Windows.Example file --# this is a comment url = "curl.curl(1) Curl Manual curl(1) -J. or as a last resort the ’%USERPROFILE%\Application Data’. Within double quotes.com/" # --. When curl is invoked. --insecure is used. it always (unless -q is used) checks for a default config file and uses it if found.27. \r and \v. --config <config file> Specify which config file to read curl arguments from. A backslash preceding any other letter is ignored.0 27 July 2012 11 . separated by whitespace.html -K.se/docs/manpage. The default config file is checked for in the following places in this order: 1) curl tries to find the "home dir": It first checks for the CURL_HOME and then the HOME environment variables.End of example file --This option can be used multiple times to load multiple config files. Note that to be able to specify a URL in the config file. the following escape sequences are available: \\.se" output = "curlhere.haxx. Curl 7. the equals sign or any combination thereof (however. it will simply try to load .

--libcurl <file> Append this option to any ordinary curl command line. (Added in 7. Especially useful if you want to machine-parse the contents of an FTP directory since the normal directory view doesn’t use a standard look or format. It is currently effective on operating systems offering the TCP_KEEPIDLE and TCP_KEEPINTVL socket options (meaning Linux. (Added in 7. --location (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code). If unspecified. This is not very common. --key <key> (SSL/SSH) Private key file name. If this option is used several times. they do not include subdirectories and symbolic links. Allows you to provide your private key in this separate file. curl only sends its credentials to the initial host. If the response code was any other 3xx code.1) Curl 7. See also --location-trusted on how to change this. --list-only (FTP) When listing an FTP directory. the last one will be used. Specify which type your --key provided private key is. PEM. --head. This option has no effect if --no-keepalive is used.27. ’private’ will instead be used. If this option is used several times. this switch forces a name-only view.18. -L. the option defaults to 60 seconds. it won’t be able to intercept the user+password. -l. The level must be entered and should be one of ’clear’. recent AIX. PEM is assumed. the last one will be used. When curl follows a redirect and the request is not a plain GET (for example POST or PUT). the last one will be used. --include or -I. This option causes an FTP NLST command to be sent. When authentication is used. this option will make curl redo the request on the new place.0) If this option is used several times. If used together with -i. and you will get a libcurl-using C source code written to the file that does the equivalent of what your command-line operation does! If this option is used several times. If a redirect takes curl to a different host. the last one will be used. --krb <level> (FTP) Enable Kerberos authentication and use. and ENG are supported. Use -V.curl(1) Curl Manual curl(1) --keepalive-time <seconds> This option sets the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. it will do the following request with a GET if the HTTP response was 301. or 303. If not specified. HP-UX and more). 302. If this option is used several times. headers from all requested pages will be shown. ’confidential’. DER. Some FTP servers list only files in their response to NLST. This option requires a library built with kerberos4 or GSSAPI (GSS-Negotiate) support. --key-type <type> (SSL) Private key file type. curl will re-send the following request using the same unmodified method. --version to see if your curl supports it. or ’private’.16. ’safe’. You can limit the amount of redirects to follow by using the --max-redirs option. Should you use a level that is not one of these. the last given file name will be used.0 27 July 2012 12 .

0) Curl 7. but will allow sending the name + password to all hosts that the site may redirect to. (Added in 7.27. It means that curl might use higher transfer speeds in short bursts.15. If the file requested is larger than this value. If this option is used several times. ’m’ or M’ makes it megabytes. NOTE: The file size is not always known prior to download. Examples: 200K. Appending ’k’ or ’K’ will count the number as kilobytes. unless a suffix is appended.2) --location-trusted (HTTP/HTTPS) Like -L. --mail-rcpt <address> (SMTP) Specify a single address that the given mail should get sent to. the last one will be used.0 27 July 2012 13 . --max-time <seconds> Maximum time in seconds that you allow the whole operation to take. See also the --connect-timeout option. (Added in 7. but over time it uses no more than the given rate. and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This feature is useful if you have a limited pipe and you’d like your transfer not to use your entire bandwidth.20.20. The given speed is measured in bytes/second. --local-port <num>[-num] Set a preferred number or range of local port numbers to use for the connection(s). the transfer will not start and curl will return with exit code 63. This concerns both FTP and HTTP transfers. while ’g’ or ’G’ makes it gigabytes. that option will take precedence and might cripple the rate-limiting slightly.25.0) --mail-from <address> (SMTP) Specify a single address that the given mail should get sent from. If you also use the -Y. This may or may not introduce a security breach if the site redirects you to a site to which you’ll send your authentication info (which is plaintext in the case of HTTP Basic authentication). This option can be used multiple times to specify many recipients. --mail-auth <address> (SMTP) Specify a single address. Note that port numbers by nature are a scarce resource that will be busy at times so setting this range to something too narrow might cause unnecessary connection setup failures.0) --max-filesize <bytes> Specify the maximum size (in bytes) of a file to download. 3m and 1G. the last one will be used. (Added in 7. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server.curl(1) Curl Manual curl(1) --limit-rate <speed> Specify the maximum transfer rate you want curl to use. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down. (Added in 7. --location. --speed-limit option. The given rate is the average speed counted during the entire transfer. -m. to help keeping the speed-limit logic working. If this option is used several times.

Note that this is the negated option name documented. use FILE protocol (file://): curl --metalink file://example. You can thus use --buffer to enforce the buffering.curl(1) Curl Manual curl(1) --max-redirs <num> Set maximum number of redirection-followings allowed. curl will enable user authentication. Using this option will disable that buffering. Example to use a remote Metalink file: curl --metalink http://www. if built against the libmetalink library. In normal work situations. See netrc(4) or ftp(1) for details on the file format. --include will be ignored. (Added in 7. --no-buffer Disables the buffering of the output stream.) -n. By default. Set this option to -1 to make it limitless. If used with HTTP.domain.21.metalink Please note that if FILE protocol is disabled.0 27 July 2012 14 .netrc to allow curl to FTP to the machine host. It will also abide by --netrc-optional if specified.0. Also note that if --metalink and --include are used together. not necessarily exactly when the data arrives.5) This option overrides any use of --netrc as they are mutually exclusive. hash check will fail. --metalink This option can tell curl to parse and process a given URI as Metalink file (both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors listed within for failover if there are errors (such as the file or server not being available). If -L. --location is used. --netrc Makes curl scan the . If this option is used several times. (Added in 7. there is no way to use a local Metalink file at the time of this writing. Curl will not complain if that file doesn’t have the right permissions (it should not be either world. This is because including headers in the response will break Metalink parser and if the headers are included in the file described in Metalink file. The environment variable "HOME" is used to find the home directory.com login myself password secret -N. this option can be used to prevent curl from following redirections "in absurdum".netrc (_netrc on Windows) file in the user’s home directory for login name and password.or group-readable).domain. This is typically used for FTP on UNIX. You can only specify one netrc file per invocation.metalink To use a Metalink file in the local file system.27. the limit is set to 50 redirections. Curl 7. the last one will be used. If several --netrc-file options are provided. curl will use a standard buffered output stream that will have the effect that it will output the data in chunks.27. A quick and very simple example of how to setup a . It will also verify the hash of the file after the download completes. --netrc-file This option is similar to --netrc.example.com/example. only the last one will be used. The Metalink file itself is downloaded and processed in memory and not stored in the local file system.com with user name ’myself’ and password ’secret’ should look similar to: machine host. except that you provide the path (absolute or relative) to the netrc file that Curl should use.

--negotiate (HTTP) Enables GSS-Negotiate authentication.com. then use --proxy-negotiate. Curl 7. Use -V.16.com would match local. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. as by default curl enables them. --user option to activate the authentication code properly. Note that this is the negated option name documented.com:80. if one is specified.27.com. but not www. only the first one is used. Each name in this list is matched as either a domain which contains the hostname. only the first one is used. --no-keepalive Disables the use of keepalive messages on the TCP connection. This option requires a library built with SSL support.19. You can thus use --keepalive to enforce keepalive. It is primarily meant as a support for Kerberos5 authentication but may be also used along with another authentication method. This is not very common. you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead. This kind of behavior should not be endorsed. (Added in 7. Use -V. It is a proprietary protocol. If you want to enable NTLM for your proxy authentication. This option requires a library built with GSSAPI support. You can thus use --sessionid to enforce session-ID caching. (Added in 7.notlocal. For example. and www. For more information see IETF draft draft-brezak-spnego-http-04. and effectively disables the proxy.com. there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. such as Digest. The only wildcard is a single * character. which matches all hosts.0 27 July 2012 15 .0) Note that this is the negated option name documented.local. but this option makes the . By default all transfers are done using the cache. When using this option. or the hostname itself. If you want to enable Negotiate for your proxy authentication. local. --noproxy <no-proxy-list> Comma-separated list of hosts which do not use a proxy. Sending a ’-u :’ is enough as the user name and password from the -u option aren’t actually used. --version to see if your curl supports NTLM. --version to see if your version supports GSS-Negotiate. --no-sessionid (SSL) Disable curl’s use of SSL session-ID caching.txt. If this option is used several times.curl(1) Curl Manual curl(1) --netrc-optional Very similar to --netrc. The GSS-Negotiate method was designed by Microsoft and is used in their web applications. reverse-engineered by clever people and implemented in curl based on their efforts. Note that while nothing should ever get hurt by attempting to reuse SSL session-IDs.netrc usage optional and not mandatory as the --netrc option does. local. --ntlm (HTTP) Enables NTLM authentication.4). then use --proxy-ntlm. you must also provide a fake -u. If this option is used several times.

you can use ’#’ followed by a number in the <file> specifier. (Only the file part of the remote file is used. make sure you change current working directory before you invoke curl with the -O.e "192. A single number works as well. the file will be saved in the current working directory.10. this option will cause non-HTTP protocols to attempt to tunnel through the proxy instead of merely using it to do HTTP-like operations. -p.e "my. from a lower to a higher number. nothing else.e "eth0" to specify which interface’s IP address you want to use (Unix only) IP address i. -P. curl then tells the server to connect back to the client’s specified address and port. --output <file> Write output to <file> instead of stdout. 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. <address> should be one of: interface i. In practice. That variable will be replaced with the current string for the URL being fetched.27.) The remote file name to use for saving is extracted from the given URL. If you want the file saved in a different directory. If you are using {} or [] to fetch multiple documents.com -o "#1_#2" You may use this option as many times as the number of URLs you have. Disable the attempt to use the EPRT command instead of PORT by using --disable-eprt.5. the last one will be used. but do note that it increases the risk of failure since the port may not be available. --ftp-port <address> (FTP) Reverses the default initiator/listener roles when connecting with FTP.168. --proxytunnel When an HTTP proxy is used (-x.txt" or use several variables like: curl http://{site. -O.host}.19.domain" to specify the machine make curl pick the same IP address that is already used for the control connection If this option is used several times. See also the --create-dirs option to create the local directories dynamically. while passive mode asks the server to setup an IP address and port for it to connect to.1" to specify the exact IP address host name i. the path is cut off.curl(1) Curl Manual curl(1) -o. Specifying the output as ’-’ (a single dash) will force the output to be done to stdout. Curl 7. That means you specify a port range. you can append ":[start]-[end]" to the right of the address.site. --remote-name flag! You may use this option as many times as the number of URLs you have.com -o "file_#1.host[1-5]. Like in: curl http://{one. Disable the use of PORT with --ftp-pasv.0 27 July 2012 16 . Starting in 7. This switch makes curl use active mode. Consequentially. --proxy).host. EPRT is really PORT++. --remote-name Write output to a local file named like the remote file we get.two}. to tell curl what TCP port range to use.

removing it from the list of protocols already permitted. --post301 (HTTP) Tells curl to respect RFC 2616/10. Basic is the default authentication method Curl 7. Available modifiers are: + Permit this protocol in addition to protocols already permitted (this is the default if no modifier is used). are comma separated. but disables ftps --proto -all.curl(1) Curl Manual curl(1) --pass <phrase> (SSL/SSH) Passphrase for the private key If this option is used several times.17.27. (Added in 7. This option is meaningful only when using -L. without relying upon support for that protocol being built into curl to avoid an error. This allows scripts to safely rely on being able to disable potentially dangerous protocols. the last one will be used. = Permit only this protocol (ignoring the list already permitted). (Added in 7.2 and not convert POST requests into GET requests when following a 302 redirection. --location (Added in 7.20. However. in which case the effect is the same as concatenating the protocols into one instance of the option. This option can be used multiple times. This might cause an extra request/response round-trip. a server may require a POST to remain a POST after such a redirection. Deny this protocol. See --proto for how protocols are represented.13. so curl does the conversion by default to maintain consistency. and are each a protocol name or ’all’. (Added in 7.+http only enables http and https --proto =http.0 27 July 2012 17 .1) --post302 (HTTP) Tells curl to respect RFC 2616/10. --location (Added in 7.3.1) --proto <protocols> Tells curl to use the listed protocols for its initial retrieval. This option is meaningful only when using -L.2 and not convert POST requests into GET requests when following a 301 redirection. Use --basic for enabling HTTP Basic with a remote host.2) --proxy-anyauth Tells curl to pick a suitable authentication method when communicating with the given proxy.2) --proto-redir <protocols> Tells curl to use the listed protocols after a redirect.19.2) --proxy-basic Tells curl to use HTTP Basic authentication when communicating with the given proxy. optionally prefixed by zero or more modifiers. so curl does the conversion by default to maintain consistency.20. though subject to later modification by subsequent entries in the comma separated list. a server may require a POST to remain a POST after such a redirection. The non-RFC behaviour is ubiquitous in web browsers. The non-RFC behaviour is ubiquitous in web browsers.https. For example: --proto -ftps uses the default protocols.https also only enables http and https Unknown protocols produce a warning. Protocols are evaluated left to right.3. However.

SFTP is a binary protocol. Unlike for FTP. (Added in 7. You must send syntactically correct FTP commands as RFC 959 defines to FTP servers. --pubkey <key> (SSH) Public key file name.1. the last one will be used.1) --proxy-ntlm Tells curl to use HTTP NTLM authentication when communicating with the given proxy. chmod mode file The chmod command modifies the file mode bits of the specified file. --quote <command> (FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. 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. it is assumed at port 1080. -Q. curl interprets SFTP quote commands itself before sending them to the server. This option can be used multiple times.curl(1) Curl Manual curl(1) curl uses with proxies.17. See the -K. is that attempts to use CONNECT through the proxy will specify an HTTP 1. The only difference between this and the HTTP proxy option (-x. --config for details on the default config file search path. prefix the command with a ’+’ (this is only supported for FTP). 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.0 protocol instead of the default HTTP 1. --proxy). the entire operation will be aborted.27. Use --ntlm for enabling NTLM with a remote host. to be exact). You may specify any number of commands. File names may be quoted shell-style to embed spaces or special characters. -q If used as the first parameter on the command line. The mode operand is an octal integer mode number. Following is the list of all supported SFTP quote commands: 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. or one of the commands listed below to SFTP servers. When speaking to an FTP server. Curl 7. The group operand is a decimal integer group ID. If this option is used several times. --proxy1. The user operand is a decimal integer user ID. prefix the command with an asterisk (*) to make curl continue even if the command fails as by default curl will stop at first failure. --proxy-negotiate Tells curl to use HTTP Negotiate authentication when communicating with the given proxy.0 <proxyhost[:port]> Use the specified HTTP 1.0 proxy. just before the transfer command(s). If the port number is not specified. Allows you to provide your public key in this separate file. Quote commands are sent BEFORE the transfer takes place (just after the initial PWD command in an FTP transfer. If the server returns failure for one of the commands.0 27 July 2012 18 . To make commands take place after a successful transfer. the curlrc config file will not be read and used. Use --digest for enabling HTTP Digest with a remote host. To make commands be sent after curl has changed the working directory. --proxy-digest Tells curl to use HTTP Digest authentication when communicating with the given proxy. Use --negotiate for enabling HTTP Negotiate with a remote host. prefix them with a dash ’-’.

--range <range> (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.0 27 July 2012 19 . 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. See also the --egd-file option.1 servers do not have this feature enabled. this will make curl attempt to figure out the timestamp of the remote file. --raw (HTTP) When used. symlink source_file target_file See ln. and if that is available make the local file get that same timestamp.2) Curl 7. rmdir directory The rmdir command removes the directory entry specified by the directory operand. The data is used to seed the random engine for SSL connections.curl(1) Curl Manual curl(1) mkdir directory_name The mkdir command creates the directory named by the directory_name operand. You should also be aware that many HTTP/1. --remote-time When used. rm file The rm command removes the file specified by the file operand. the server’s response will be unspecified. the last one will be used. depending on the server’s configuration. If this option is used several times.16. FTP or SFTP server or a local FILE. so that when you attempt to get a range.600-799 specifies 300 bytes from offset 500(H) 100-199. you’ll instead get the whole document. FTP and SFTP range downloads only support the simple ’start-stop’ syntax (optionally with one of the numbers omitted). (Added in 7. it disables all internal HTTP decoding of content or transfer encodings and instead makes them passed on unaltered. FTP use depends on the extended FTP command SIZE. If a nondigit character is given in the range.1.27. Ranges can be specified in a number of ways. -r.500-599 specifies two separate 100-byte ranges(*)(H) (*) = NOTE that this will cause the server to reply with a multipart response! Only digit characters (0-9) are valid in the ’start’ and ’stop’ fields of the ’start-stop’ range syntax. raw. -R. 0-499 500-999 -500 95000-0. --random-file <file> (SSL) Specify the path name to file containing what will be considered as random data.e a partial document) from a HTTP/1.-1 specifies the first 500 bytes specifies the second 500 bytes specifies the last 500 bytes specifies the bytes from offset 9500 and forward specifies the first and last byte only(*)(H) 500-700. provided it is empty. pwd The pwd command returns the absolute pathname of the current working directory.

Makes Curl mute. --max-time. By using --retry-delay you disable this exponential backoff algorithm.0 27 July 2012 20 . Retries will be done as usual (see --retry) as long as the timer hasn’t reached this given limit.21. (Added in 7. IMAP.0). See also --retry-max-time to limit the total time allowed for retries. -s.12.19. Consider it a sort of /etc/hosts alternative provided on the command line.3) If this option is used several times. Using this.27. --retry-max-time <seconds> The retry timer is reset before the first transfer attempt. This option can be used many times to add many host names to resolve. --remote-name were used for each one. --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). the last one will be used. So if you want to disable that for a specific URL after --remote-name-all has been used. To limit a single request´s maximum time. Notice that if the timer hasn’t reached the limit. This option is only interesting if --retry is also used.12. an FTP 4xx response code or an HTTP 5xx response code. use -m. That option name can still be used but will be removed in a future version. --ssl (FTP. it may take longer than this given time period. -S. When curl is about to retry a transfer. (Added in 7. --show-error When used with -s it makes curl show an error message if it fails. See also --ftp-ssl-control and --ssl-reqd for different levels of encryption required. Setting the number to 0 makes curl do no retries (which is the default). (Added in 7.12.0) This option was formerly known as --ftp-ssl (Added in 7.curl(1) Curl Manual curl(1) --remote-name-all This option changes the default action for all given URLs to be dealt with as if -O. 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. the request will be made and while performing.11. (Added in 7. Transient error means either: a timeout.0) --resolve <host:port:address> Provide a custom address for a specific host and port pair. Don’t show progress meter or error messages. SMTP) Try to use SSL/TLS for the connection. you must use "-o -" or --no-remote-name. Curl 7.3) --retry <num> If a transient error is returned when curl tries to perform a transfer.3) If this option is used several times. POP3. Set this option to zero to not timeout retries. it will retry this number of times before giving up. the last one will be used. the last one will be used. you can make the curl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. (Added in 7. Setting this delay to zero will make curl use the default backoff time. (Added in 7. 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.3) If this option is used several times.20. --silent Silent or quiet mode. Reverts to a non-secure connection if the server doesn’t support SSL/TLS.

the last one will be used.2) This option overrides any previous use of -x. That option name can still be used but will be removed in a future version. this option is superfluous since you can specify a socks4a proxy with -x. it is assumed at port 1080.21.7. (Added in 7. --socks5-hostname <host[:port]> Use the specified SOCKS5 proxy (and let the proxy resolve the host name). --proxy.15.curl(1) Curl Manual curl(1) --ssl-reqd (FTP. If the port number is not specified.) --socks5 <host[:port]> Use the specified SOCKS5 proxy . Since 7. and by using this flag you ask for exactly that. --proxy using a socks5h:// protocol prefix. --proxy using a socks4:// protocol prefix. If this option is used several times. as they are mutually exclusive. as they are mutually exclusive. SMTP) Require SSL/TLS for the connection. the last one will be used. This option overrides any previous use of -x. If the port number is not specified. IMAP. it is assumed at port 1080. (This option was previously wrongly documented and used as --socks without the number appended.21.0 27 July 2012 21 . (This option was previously wrongly Curl 7. the SSL layer may use work-arounds known to cause interoperability problems with some older SSL implementations.5). this option is superfluous since you can specify a socks4 proxy with -x. it is assumed at port 1080.25.7. it is assumed at port 1080. If this option is used several times. the last one will be used. this option is superfluous since you can specify a socks5 proxy with -x.21.20. --proxy.18. Since 7. WARNING: this option loosens the SSL security. --proxy using a socks4a:// protocol prefix.but resolve the host name locally. Terminates the connection if the server doesn’t support SSL/TLS. --proxy using a socks5:// protocol prefix.0) This option overrides any previous use of -x.7. --proxy.0 protocols known as BEAST.27.0) --socks4 <host[:port]> Use the specified SOCKS4 proxy.18.0) This option overrides any previous use of -x. Since 7. If the port number is not specified.21. If this option is used several times. as they are mutually exclusive. (Added in 7. If this option isn’t used. as they are mutually exclusive.7. --ssl-allow-beast (SSL) This option tells curl to not work around a security flaw in the SSL3 and TLS1. the last one will be used. --proxy. If this option is used several times. POP3. --socks4a <host[:port]> Use the specified SOCKS4a proxy. this option is superfluous since you can specify a socks5 hostname proxy with -x. (Added in 7. If the port number is not specified. (Added in 7.0) This option was formerly known as --ftp-ssl-reqd (added in 7. Since 7.15. (Added in 7.

NOTE that you must use a trailing / on the last directory to really prove to Curl that there is no file name or curl will think that your last directory name is the remote file name to use. curl also supports "globbing" of the -T argument. but the NEC reference implementation does not.4 it should be protected. XDISPLOC=<X display> Sets the X display location. RFC 1961 says in section 4. (Added in 7.11. 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.0 27 July 2012 22 . If this is used on an HTTP(S) server.png" ftp://ftp. If there is no file part in the specified URL.file2}" http://www. Curl will append the local file name. meaning that you can upload multiple files to a single URL by using the same URL globbing style supported in the URL.) This option (as well as --socks4) does not work with IPV6. (Added in 7.4).3/4.val> Sets an environment variable. --stderr <file> Redirect all writes to stderr to the specified file instead. the last one will be used.4). Supported options are: TTYPE=<term> Sets the terminal type. NEW_ENV=<var.19. --telnet-option <OPT=val> Pass options to the telnet protocol. This option allows you to change it. --socks5-gssapi-service <servicename> The default service name for a socks server is rcmd/server-fqdn." (a single period) may be specified instead of "-" to use stdin in non-blocking mode to allow reading server output while stdin is being uploaded. (Added in 7. --socks5-gssapi-nec As part of the gssapi negotiation a protection mode is negotiated. -T. --upload-file <file> This transfers the specified local file to the remote URL.2) Curl 7.uploadtothissite. You can specify one -T for each URL on the command line. The option --socks5-gssapi-nec allows the unprotected exchange of the protection mode negotiation.com/upload/ --tcp-nodelay Turn on the TCP_NODELAY option. the PUT command will be used.27.picturemania. FTPS or LDAP. the file name ". Each -T + URL pair specifies what to upload and to where. Alternately.com or even curl -T "img[1-1000].19. If this option is used several times.curl(1) Curl Manual curl(1) documented and used as --socks without the number appended. See the curl_easy_setopt(3) man page for details about this option. That will most likely cause the upload operation to fail. it is instead written to stdout. -t. If the file name is a plain ’-’. Use the file name "-" (a single dash) to use stdin instead of a given file. like this: curl -T "{file1.

--trace-ascii <file> Enables a full trace dump of all incoming and outgoing data.0) --tlsauthtype <authtype> Set TLS authentication type. (Added in 7. Overrides -n. This is the block size that curl will try to use when transferring data to or from a TFTP server. but leaves out the hex part and only shows the ASCII part of the dump. If you just give the user name (without entering a colon) curl will prompt for a password.0 27 July 2012 23 . If you use an SSPI-enabled curl binary and do NTLM authentication. --verbose or --trace-ascii.4) --tlspassword <password> Set password for use with the TLS authentication method specified with --tlsauthtype. If this option is used several times. for TLS-SRP (RFC 5054). the last one will be used. (Added in 7. --verbose or --trace.14. It makes smaller output that might be easier to read for untrained humans. --netrc and --netrc-optional.6) --trace <file> Enables a full trace dump of all incoming and outgoing data. the only supported option is "SRP".4) --tlsuser <user> Set username for use with the TLS authentication method specified with --tlsauthtype. This option overrides previous uses of -v. --user <user:password> Specify the user name and password to use for server authentication.27. Currently. and uncompress the data while receiving it. (Added in 7. you can force curl to pick up the user name and password from your environment by simply specifying a single colon with this option: "-u :".21. If this option is used several times.curl(1) Curl Manual curl(1) --tftp-blksize <value> (TFTP) Set TFTP BLKSIZE option (must be >512). to the given output file. including descriptive information. (Added in 7. then this option defaults to "SRP". This option overrides previous uses of -v. --trace-time Prepends a time stamp to each trace or verbose line that curl displays. This is very similar to --trace. Requires that --tlspassword also be set. Use "-" as filename to have the output sent to stdout. If this option is used several times. the last one will be used. Requires that --tlsuser also be set. By default 512 bytes will be used. (Added in 7.21.21.20. the last one will be used. including descriptive information. Use "-" as filename to have the output sent to stdout. (Added in 7.4) --tr-encoding (HTTP) Request a compressed Transfer-Encoding response using one of the algorithms curl supports. to the given output file. If --tlsuser and --tlspassword are specified but --tlsauthtype is not. Curl 7.0) -u.21.

The variables present in the output format will be substituted by the value or text that curl thinks fit.1) ftp_entry_path The initial path curl ended up in when logging on to the remote FTP server. --write-out <format> Defines what to display on stdout after a completed and successful operation. --verbose Makes the fetching more verbose/talkative. --remote-name options. as described below. Note that if you only want HTTP headers in the output. Use -s. to get read from a particular file you specify it "@filename" and to tell curl to read the format from stdin you write "@-". --include might be the option you’re looking for. and a line starting with ’*’ means additional info provided by curl. A line starting with ’>’ means "header data" sent by curl. the last one will be used. This option may be used any number of times.27. --proxy-user <user:password> Specify the user name and password to use for proxy authentication. --output or the -O. -i. --url <URL> Specify a URL to fetch. ’<’ means "header data" received by curl that is hidden in normal cases. This option overrides previous uses of --trace-ascii or --trace. --silent to make curl quiet. filename_effective The ultimate filename that curl writes out to. use the -o. (Added in 7. if there was any. It’s most useful in combination with the --remote-header-name option.curl(1) Curl Manual curl(1) If this option is used several times. You can output a newline by using \n. All variables are specified as %{variable_name} and to output a normal % you just write them as %%. This is only meaningful if curl is told to write to a file with the --remote-name or --output option. the last one will be used. -U. The variables available are: content_type The Content-Type of the requested document. If you think this option still doesn’t give you enough details.0 27 July 2012 24 .4) Curl 7. If this option is used several times. consider using --trace or --trace-ascii instead. If you use an SSPI-enabled curl binary and do NTLM authentication. where all occurrences of % must be doubled when using this option. a carriage return with \r and a tab space with \t.25. The string can be specified as "string". (Added in 7. Mostly useful for debugging. The format is a string that may contain plain text mixed with any number of variables.15. -w. you can force curl to pick up the user name and password from your environment by simply specifying a single colon with this option: "-U :". To control where this URL is written. -v. This option is mostly handy when you want to specify URL(s) in a config file. NOTE: The %-symbol is a special symbol in the win32-environment.

in seconds.29. this variable will show the actual URL a redirect would take you to. in seconds. time_redirect The time.0) The remote port number of the most recently done connection (Added in 7.0) The total amount of bytes that were downloaded.19. ssl_verify_result The result of the SSL peer certificate verification that was requested. it took from the start until the TCP connect to the remote host (or proxy) was completed.2 the alias response_code was added to show the same info.4) The IP address of the local end of the most recently done connection .can be either IPv4 or IPv6 (Added in 7.0) time_appconnect The time. http_connect local_ip local_port num_connects num_redirects redirect_url remote_ip remote_port size_download size_header size_request size_upload speed_download speed_upload The average upload speed that curl measured for the complete upload. in seconds. time_namelookup The time.0) time_connect The time. The average download speed that curl measured for the complete download.12. The total amount of bytes of the downloaded headers. pretransfer and transfer before the final transaction was started. (Added in 7. it took from the start until the name resolving was completed.29. it took for all redirection steps include name lookup. Bytes per second.can be either IPv4 or IPv6 (Added in 7.3) When an HTTP request was made without -L to follow redirects.3) time_starttransfer The time. (Added in 7. (Added in 7. in seconds. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. In 7.18. (Added in 7. in seconds. 0 means the verification was successful. (Added in 7. (Added in 7.2) The remote IP address of the most recently done connection .18. Bytes per second.29.27.0) Number of new connects made in the recent transfer.0 27 July 2012 25 .curl(1) Curl Manual curl(1) http_code The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. connect. The total amount of bytes that were uploaded.19.12. time_pretransfer The time. The numerical code that was found in the last response (from a proxy) to a curl CONNECT request.3) Number of redirects that were followed in the request.12.12. it took from the start until the file transfer was just about to begin.29. it took from the start until the first byte was just about to be transferred. time_redirect shows the complete execution time for multiple redirections. The total amount of bytes that were sent in the HTTP request. (Added in 7.0) The local port number of the most recently done connection (Added in 7. in seconds. This includes time_pretransfer and also the time the server Curl 7.

You need to use the -I. --request <command> (HTTP) Specifies a custom request method to use when communicating with the HTTP server. HEAD.7. a warning is issued. --proxy <[protocol://][user:password@]proxyhost[:port]> Use the specified HTTP proxy. the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. --xattr When saving output to a file. So for example if you want to make a proper HEAD request.url attribute and. --head option. Normally you don’t need this option. time_total url_effective The total time. The specified request will be used instead of the method otherwise used (which defaults to GET).0 27 July 2012 26 . This option only changes the actual word used in the HTTP request. the last one will be used. Read the HTTP 1. POST and PUT requests are rather invoked by using dedicated command line options. -x. No protocol specified. This is most meaningful if you’ve told curl to follow location: headers. Curl 7. If the port number is not specified. The URL that was fetched last. http:// and all others will be treated as HTTP proxies.21. the URL is stored in the xdg. the last one will be used. If the file system does not support extended attributes. MOVE and more. for HTTP.origin.1 specification for details and explanations.27. From 7. User and password that might be provided in the proxy string are URL decoded by curl. Currently. If this option is used several times. It means that certain protocol specific operations might not be available. the last one will be used. If there’s an environment variable setting a proxy. it does not alter the way curl behaves. This option overrides existing environment variables that set the proxy to use. --proxytunnel option. The proxy host can be specified the exact same way as the proxy environment variables. Use socks4://. including the protocol prefix (http://) and the embedded user + password. it is assumed at port 1080. as one with the -p. using -X HEAD will not suffice.curl(1) Curl Manual curl(1) needed to calculate the result. but related technologies like WebDAV offers PROPFIND. This is not the case if you can tunnel through the proxy. COPY. the content type is stored in the mime_type attribute. this option tells curl to store certain file metadata in extened file attributes. Common additional HTTP requests include PUT and DELETE. -X. All operations that are performed over an HTTP proxy will transparently be converted to HTTP. The time will be displayed with millisecond resolution. All sorts of GET. that the full operation lasted. If this option is used several times. in seconds. you can set proxy to "" to override it. socks5:// or socks5h:// to request the specific SOCKS version to be used. socks4a://. This allows you to pass in special characters such as @ by using %40 or pass in a colon with %3a. If this option is used several times. (FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP.

Krb4 for FTP is supported. speed-time is set with -y and is 30 if not set. See the curl_getdate(3) man pages for date expression details. The second line (starts with "Protocols:") shows all protocols that libcurl reports to support.27. -h. GSS-Negotiate Negotiate authentication and krb5 for FTP is supported. try the --connect-timeout option. the last one will be used. --speed-limit <speed> If a download is slower than this given speed (in bytes per second) for speed-time seconds it gets aborted. default is a document that is newer than the specified date/time. The third line (starts with "Features:") shows specific features libcurl reports to offer. Curl 7. If this is a concern for you. For curl-developers only! AsynchDNS This curl uses asynchronous name resolves. Start the date expression with a dash (-) to make it request for a document that is older than the given date/time. This enables more error-tracking and memory debugging etc. -V. the last one will be used. If speed-time is used. If this option is used several times. it is taken as a filename and tries to get the modification date (mtime) from <file> instead. the last one will be used. Automatic decompression of compressed files over HTTP is supported. Display the huge help text.0 27 July 2012 27 . The <date expression> can be all sorts of date strings or if it doesn’t match any internal ones. If this option is used several times. This option controls transfers and thus will not affect slow connects etc. -M. or one that has been modified before that time.curl(1) Curl Manual curl(1) -y. libcurl and other 3rd party libraries linked with the executable. the default speed-limit will be 1 unless set with -Y. --help Usage help. --speed-time <time> If a download is slower than speed-limit bytes per second during a speed-time period. --version Displays information about curl and the libcurl version it uses. Available features include: IPv6 krb4 SSL libz You can use IPv6 with this. the download gets aborted. HTTPS and FTPS are supported. -Y. If this option is used several times. Debug This curl uses a libcurl built with Debug. NTLM NTLM authentication is supported. The first line includes the full version of curl. -z/--time-cond <date expression>|<file> (HTTP/FTP) Request a file that has been modified later than the given time and date. --manual Manual.

7. the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. curl will use mirrors for failover if there are errors (such as the file or server not being available). POP3.0 27 July 2012 28 . PROXY PROTOCOL PREFIXES Since curl version 7. HTTPS_PROXY [protocol://]<host>[:port] Sets the proxy server to use for HTTPS. ENVIRONMENT The environment variables can be specified in lower case or upper case. The supported proxy protocol prefixes are as follows: socks4:// Makes it the equivalent of --socks4 socks4a:// Makes it the equivalent of --socks4a Curl 7. see -K. SSPI is supported.21. http_proxy [protocol://]<host>[:port] Sets the proxy server to use for HTTP. The lower case version has precedence. the proxy will be treated as an HTTP proxy.curlrc Default config file. FILES ˜/. IMAP. If set to a asterisk ’*’ only. curl will authenticate with your current user and password. Metalink This curl supports Metalink (both version 3 and 4 (RFC 5854)). SMTP. http_proxy is an exception as it is only available in lower case. [url-protocol]_PROXY [protocol://]<host>[:port] Sets the proxy server to use for [url-protocol]. FTPS. LDAP etc. If no protocol is specified in the proxy string or if the string doesn’t match a supported one. files larger than 2GB.27. NO_PROXY <comma-separated list of hosts> list of host names that shouldn’t go through any proxy. TLS-SRP SRP (Secure Remote Password) authentication is supported for TLS. IDN SSPI This curl supports IDN . Largefile This curl supports transfers of large files. it matches all hosts.curl(1) Curl Manual curl(1) SPNEGO SPNEGO Negotiate authentication is supported. where the protocol is a protocol that curl supports and as specified in a URL. ALL_PROXY [protocol://]<host>[:port] Sets the proxy server to use if no protocol-specific proxy is set. which describes mirrors and hashes. --config for details. If you use NTLM and set a blank user name.international domain names. FTP. Using an environment variable to set the proxy has the same effect as using the --proxy option.

The given remote host was not resolved. Couldn’t change transfer method to binary. FTP couldn’t download/access the given file. FTP couldn’t set binary. This command is used for resumed FTP transfers. The SSL handshaking failed. Most often you tried to change to a directory that doesn’t exist on the server. The server denied login or denied access to the particular resource or directory you wanted to reach. The specified time-out period was reached according to the conditions. HTTP range error. At the time of this writing. Read error. Curl couldn’t parse the reply sent to the PASS request. Partial file. The REST command failed. FTP PORT failed. FTP weird 227 format. FTP quote error. SSL connect error. FTP weird server reply. 5 6 7 8 9 11 13 14 15 17 18 19 21 22 23 25 26 27 28 30 31 33 34 35 Curl 7.curl(1) Curl Manual curl(1) socks5:// Makes it the equivalent of --socks5 socks5h:// Makes it the equivalent of --socks5-hostname EXIT CODES There are a bunch of different error codes and their corresponding error messages that may appear during bad conditions. The server denied the STOR operation. FTP access denied. Curl couldn’t parse the 227-line the server sent. A memory allocation request failed. Curl couldn’t write data to a local filesystem or similar. URL malformed. FTP weird PASS reply. Curl couldn’t parse the reply sent to the PASV request. Various reading problems. A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. The given proxy host could not be resolved. HTTP post error. the exit codes are: 1 2 3 4 Unsupported protocol. The requested url was not found or returned another error with the HTTP error code being 400 or above. you probably need another build of libcurl! Couldn’t resolve proxy. This build of curl has no support for this protocol. This return code only appears if -f. HTTP page not retrieved. Couldn’t resolve host. FTP can’t get host. FTP weird PASV reply. A quote command returned error from the server.27. Failed to initialize. Couldn’t resolve the host IP we got in the 227-line. To make curl able to do this. used for FTP uploading. The range "command" didn’t work. The server sent data curl couldn’t parse. --fail is used. The PORT command failed. Out of memory. try doing a transfer using PASV instead! FTP couldn’t use REST. Not all FTP servers support the PORT command. Write error. The syntax was not correct. Operation timeout.0 27 July 2012 29 . FTP couldn’t STOR file. the RETR (or similar) command failed. Internal post-request generation error. Failed to connect to host. Only a part of the file was transferred.

curl(1) Curl Manual curl(1) 36 37 38 39 41 42 43 45 47 48 49 51 52 53 54 55 56 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 FTP bad download resume. Problem with reading the SSL CA cert (path? access rights?). File not found on TFTP server. File already exists (TFTP). SSL crypto engine not found. Character conversion functions required. password. Unknown option specified to libcurl. which here is considered an error. Peer certificate cannot be authenticated with known CA certificates. The peer’s SSL certificate or SSH MD5 fingerprint was not OK. Couldn’t continue an earlier aborted download. Character conversion failed. No such user (TFTP). Failure in receiving network data. A function was called with a bad parameter. Problem with the local certificate. Failed sending network data.27. When following redirects. The user name. FILE couldn’t read file. Requested FTP SSL level failed. Maximum file size exceeded. Failed to open the file. Interface error. Unknown TFTP transfer ID. Aborted by callback.0 27 July 2012 30 . Permissions? LDAP cannot bind. Couldn’t use specified SSL cipher. Sending the data requires a rewind that failed. curl hit the maximum amount. Failed to initialise SSL Engine. Illegal TFTP operation. or similar was not accepted and curl failed to log in. Unrecognized transfer encoding. Out of disk space on TFTP server. A required LDAP function was not found. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Curl 7. The server didn’t reply anything. Invalid LDAP URL. LDAP search failed. Permission problem on TFTP server. LDAP bind operation failed. Cannot set SSL crypto engine as default. Too many redirects. The resource referenced in the URL does not exist. Function not found. Internal error. An application told curl to abort the operation. Read up in the manual! Malformed telnet option. A specified outgoing interface could not be used.

19.0).curl(1) Curl Manual curl(1) 79 80 82 83 84 85 86 87 88 XX An unspecified error occurred during the SSH session.se/pub/www/utilities/curl/ SEE ALSO ftp(1). but the whole list of contributors is found in the separate THANKS file.0). missing or wrong format (added in 7. Could not load CRL file.sunet. Failed to shut down the SSL connection. AUTHORS / CONTRIBUTORS Daniel Stenberg is the main author. Issuer check failed (added in 7. The existing ones are meant to never change.se FTP ftp://ftp.haxx. wget(1) Curl 7.19.27.0 27 July 2012 31 . The FTP PRET command failed RTSP: mismatch of CSeq numbers RTSP: mismatch of Session Identifiers unable to parse FTP file list FTP chunk callback reported error More error codes will appear here in future releases. WWW http://curl.