curl.1 102 KB

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