page-header 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
  26. .\"
  27. .TH curl 1 "%DATE" "curl %VERSION" "curl Manual"
  28. .SH NAME
  29. curl \- transfer a URL
  30. .SH SYNOPSIS
  31. .B curl [options / URLs]
  32. .SH DESCRIPTION
  33. **curl** is a tool for transferring data from or to a server. It supports these
  34. protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS,
  35. LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP,
  36. SMTPS, TELNET, TFTP, WS and WSS. The command is designed to work without user
  37. interaction.
  38. curl offers a busload of useful tricks like proxy support, user
  39. authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
  40. resume and more. As you will see below, the number of features will make your
  41. head spin.
  42. curl is powered by libcurl for all transfer-related features. See
  43. *libcurl(3)* for details.
  44. .SH URL
  45. The URL syntax is protocol-dependent. You find a detailed description in
  46. RFC 3986.
  47. You can specify multiple URLs or parts of URLs by writing part sets within
  48. braces and quoting the URL as in:
  49. "http://site.{one,two,three}.com"
  50. or you can get sequences of alphanumeric series by using [] as in:
  51. "ftp://ftp.example.com/file[1-100].txt"
  52. "ftp://ftp.example.com/file[001-100].txt" (with leading zeros)
  53. "ftp://ftp.example.com/file[a-z].txt"
  54. Nested sequences are not supported, but you can use several ones next to each
  55. other:
  56. "http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html"
  57. You can specify any amount of URLs on the command line. They will be fetched
  58. in a sequential manner in the specified order unless you use --parallel. You
  59. can specify command line options and URLs mixed and in any order on the
  60. command line.
  61. You can specify a step counter for the ranges to get every Nth number or
  62. letter:
  63. "http://example.com/file[1-100:10].txt"
  64. "http://example.com/file[a-z:2].txt"
  65. When using [] or {} sequences when invoked from a command line prompt, you
  66. probably have to put the full URL within double quotes to avoid the shell from
  67. interfering with it. This also goes for other characters treated special, like
  68. for example '&', '?' and '*'.
  69. Provide the IPv6 zone index in the URL with an escaped percentage sign and the
  70. interface name. Like in
  71. "http://[fe80::3%25eth0]/"
  72. If you specify a URL without a protocol:// scheme, curl guesses what protocol
  73. you want. It then defaults to HTTP but assumes others based on often-used host
  74. name prefixes. For example, for host names starting with "ftp." curl assumes
  75. you want FTP.
  76. curl attempts to re-use connections when doing multiple file transfers, so
  77. that getting many files from the same server do not use multiple connects /
  78. handshakes. This improves speed. Connection re-use can only be done for URLs
  79. specified for a single command line invocation and cannot be performed between
  80. separate curl runs.
  81. .SH VARIABLES
  82. Starting in curl 8.3.0, curl supports command line variables. Set variables
  83. with --variable name=content or --variable name@file (where "file" can be
  84. stdin if set to a single dash (-)).
  85. Variable contents can expanded in option parameters using "{{name}}" (without
  86. the quotes) if the option name is prefixed with "--expand-". This gets the
  87. contents of the variable "name" inserted, or a blank if the name does not
  88. exist as a variable. Insert "{{" verbatim in the string by prefixing it with a
  89. backslash, like "\\{{".
  90. You an access and expand environment variables by first importing them. You
  91. can select to either require the environment variable to be set or you can
  92. provide a default value in case it is not already set. Plain --variable %name
  93. imports the variable called 'name' but exits with an error if that environment
  94. variable is not already set. To provide a default value if it is not set, use
  95. --variable %name=content or --variable %name@content.
  96. Example. Get the USER environment variable into the URL, fail if USER is not
  97. set:
  98. --variable '%USER'
  99. --expand-url = "https://example.com/api/{{USER}}/method"
  100. When expanding variables, curl supports a set of functions that can make the
  101. variable contents more convenient to use. It can trim leading and trailing
  102. white space with *trim*, it can output the contents as a JSON quoted string
  103. with *json*, URL encode the string with *url* or base64 encode it with
  104. *b64*. You apply function to a variable expansion, add them colon separated to
  105. the right side of the variable. Variable content holding null bytes that are
  106. not encoded when expanded, will cause error.
  107. Example: get the contents of a file called $HOME/.secret into a variable
  108. called "fix". Make sure that the content is trimmed and percent-encoded sent
  109. as POST data:
  110. --variable %HOME
  111. --expand-variable fix@{{HOME}}/.secret
  112. --expand-data "{{fix:trim:urlencode}}"
  113. https://example.com/
  114. Command line variables and expansions were added in in 8.3.0.
  115. .SH OUTPUT
  116. If not told otherwise, curl writes the received data to stdout. It can be
  117. instructed to instead save that data into a local file, using the --output or
  118. --remote-name options. If curl is given multiple URLs to transfer on the
  119. command line, it similarly needs multiple options for where to save them.
  120. curl does not parse or otherwise "understand" the content it gets or writes as
  121. output. It does no encoding or decoding, unless explicitly asked to with
  122. dedicated command line options.
  123. .SH PROTOCOLS
  124. curl supports numerous protocols, or put in URL terms: schemes. Your
  125. particular build may not support them all.
  126. .IP DICT
  127. Lets you lookup words using online dictionaries.
  128. .IP FILE
  129. Read or write local files. curl does not support accessing file:// URL
  130. remotely, but when running on Microsoft Windows using the native UNC approach
  131. will work.
  132. .IP FTP(S)
  133. curl supports the File Transfer Protocol with a lot of tweaks and levers. With
  134. or without using TLS.
  135. .IP GOPHER(S)
  136. Retrieve files.
  137. .IP HTTP(S)
  138. curl supports HTTP with numerous options and variations. It can speak HTTP
  139. version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct
  140. command line options.
  141. .IP IMAP(S)
  142. Using the mail reading protocol, curl can "download" emails for you. With or
  143. without using TLS.
  144. .IP LDAP(S)
  145. curl can do directory lookups for you, with or without TLS.
  146. .IP MQTT
  147. curl supports MQTT version 3. Downloading over MQTT equals "subscribe" to a
  148. topic while uploading/posting equals "publish" on a topic. MQTT over TLS is
  149. not supported (yet).
  150. .IP POP3(S)
  151. Downloading from a pop3 server means getting a mail. With or without using
  152. TLS.
  153. .IP RTMP(S)
  154. The **Realtime Messaging Protocol** is primarily used to serve streaming media
  155. and curl can download it.
  156. .IP RTSP
  157. curl supports RTSP 1.0 downloads.
  158. .IP SCP
  159. curl supports SSH version 2 scp transfers.
  160. .IP SFTP
  161. curl supports SFTP (draft 5) done over SSH version 2.
  162. .IP SMB(S)
  163. curl supports SMB version 1 for upload and download.
  164. .IP SMTP(S)
  165. Uploading contents to an SMTP server means sending an email. With or without
  166. TLS.
  167. .IP TELNET
  168. Telling curl to fetch a telnet URL starts an interactive session where it
  169. sends what it reads on stdin and outputs what the server sends it.
  170. .IP TFTP
  171. curl can do TFTP downloads and uploads.
  172. .SH "PROGRESS METER"
  173. curl normally displays a progress meter during operations, indicating the
  174. amount of transferred data, transfer speeds and estimated time left, etc. The
  175. progress meter displays the transfer rate in bytes per second. The suffixes
  176. (k, M, G, T, P) are 1024 based. For example 1k is 1024 bytes. 1M is 1048576
  177. bytes.
  178. curl displays this data to the terminal by default, so if you invoke curl to
  179. do an operation and it is about to write data to the terminal, it
  180. *disables* the progress meter as otherwise it would mess up the output
  181. mixing progress meter and response data.
  182. If you want a progress meter for HTTP POST or PUT requests, you need to
  183. redirect the response output to a file, using shell redirect (>), --output or
  184. similar.
  185. This does not apply to FTP upload as that operation does not spit out any
  186. response data to the terminal.
  187. If you prefer a progress "bar" instead of the regular meter, --progress-bar is
  188. your friend. You can also disable the progress meter completely with the
  189. --silent option.
  190. .SH VERSION
  191. This man page describes curl %VERSION. If you use a later version, chances are
  192. this man page does not fully document it. If you use an earlier version, this
  193. document tries to include version information about which specific version
  194. that introduced changes.
  195. You can always learn which the latest curl version is by running
  196. .nf
  197. curl https://curl.se/info
  198. .fi
  199. .SH OPTIONS
  200. Options start with one or two dashes. Many of the options require an
  201. additional value next to them.
  202. The short "single-dash" form of the options, -d for example, may be used with
  203. or without a space between it and its value, although a space is a recommended
  204. separator. The long "double-dash" form, --data for example, requires a space
  205. between it and its value.
  206. Short version options that do not need any additional values can be used
  207. immediately next to each other, like for example you can specify all the
  208. options *-O*, *-L* and *-v* at once as *-OLv*.
  209. In general, all boolean options are enabled with --**option** and yet again
  210. disabled with --**no-**option. That is, you use the same option name but
  211. prefix it with "no-". However, in this list we mostly only list and show the
  212. *--option* version of them.
  213. When --next is used, it resets the parser state and you start again with a
  214. clean option state, except for the options that are "global". Global options
  215. will retain their values and meaning even after --next.
  216. The following options are global:
  217. %GLOBALS.