page-header 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2020, 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. .\" **************************************************************************
  22. .\"
  23. .\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
  24. .\"
  25. .TH curl 1 "16 Dec 2016" "Curl 7.52.0" "Curl Manual"
  26. .SH NAME
  27. curl \- transfer a URL
  28. .SH SYNOPSIS
  29. .B curl [options / URLs]
  30. .SH DESCRIPTION
  31. .B curl
  32. is a tool to transfer data from or to a server, using one of the supported
  33. protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,
  34. LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP,
  35. SMTPS, TELNET and TFTP). The command is designed to work without user
  36. interaction.
  37. curl offers a busload of useful tricks like proxy support, user
  38. authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
  39. resume, Metalink, and more. As you will see below, the number of features will
  40. make your head spin!
  41. curl is powered by libcurl for all transfer-related features. See
  42. \fIlibcurl(3)\fP for details.
  43. .SH URL
  44. The URL syntax is protocol-dependent. You'll find a detailed description in
  45. RFC 3986.
  46. You can specify multiple URLs or parts of URLs by writing part sets within
  47. braces and quoting the URL as in:
  48. "http://site.{one,two,three}.com"
  49. or you can get sequences of alphanumeric series by using [] as in:
  50. "ftp://ftp.example.com/file[1-100].txt"
  51. "ftp://ftp.example.com/file[001-100].txt" (with leading zeros)
  52. "ftp://ftp.example.com/file[a-z].txt"
  53. Nested sequences are not supported, but you can use several ones next to each
  54. other:
  55. "http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html"
  56. You can specify any amount of URLs on the command line. They will be fetched
  57. in a sequential manner in the specified order. You can specify command line
  58. options and URLs mixed and in any order on the command line.
  59. You can specify a step counter for the ranges to get every Nth number or
  60. letter:
  61. "http://example.com/file[1-100:10].txt"
  62. "http://example.com/file[a-z:2].txt"
  63. When using [] or {} sequences when invoked from a command line prompt, you
  64. probably have to put the full URL within double quotes to avoid the shell from
  65. interfering with it. This also goes for other characters treated special, like
  66. for example '&', '?' and '*'.
  67. Provide the IPv6 zone index in the URL with an escaped percentage sign and the
  68. interface name. Like in
  69. "http://[fe80::3%25eth0]/"
  70. If you specify URL without protocol:// prefix, curl will attempt to guess what
  71. protocol you might want. It will then default to HTTP but try other protocols
  72. based on often-used host name prefixes. For example, for host names starting
  73. with "ftp." curl will assume you want to speak FTP.
  74. curl will do its best to use what you pass to it as a URL. It is not trying to
  75. validate it as a syntactically correct URL by any means but is instead
  76. \fBvery\fP liberal with what it accepts.
  77. curl will attempt to re-use connections for multiple file transfers, so that
  78. getting many files from the same server will not do multiple connects /
  79. handshakes. This improves speed. Of course this is only done on files
  80. specified on a single command line and cannot be used between separate curl
  81. invokes.
  82. .SH OUTPUT
  83. If not told otherwise, curl writes the received data to stdout. It can be
  84. instructed to instead save that data into a local file, using the --output or
  85. --remote-name options. If curl is given multiple URLs to transfer on the
  86. command line, it similarly needs multiple options for where to save them.
  87. curl does not parse or otherwise "understand" the content it gets or writes as
  88. output. It does no encoding or decoding, unless explicitly asked so with
  89. dedicated command line options.
  90. .SH PROTOCOLS
  91. curl supports numerous protocols, or put in URL terms: schemes. Your
  92. particular build may not support them all.
  93. .IP DICT
  94. Lets you lookup words using online dictionaries.
  95. .IP FILE
  96. Read or write local files. curl does not support accessing file:// URL
  97. remotely, but when running on Microsft Windows using the native UNC approach
  98. will work.
  99. .IP FTP(S)
  100. curl supports the File Transfer Protocol with a lot of tweaks and levers. With
  101. or without using TLS.
  102. .IP GOPHER
  103. Retrieve files.
  104. .IP HTTP(S)
  105. curl supports HTTP with numerous options and variations. It can speak HTTP
  106. version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct
  107. command line options.
  108. .IP IMAP(S)
  109. Using the mail reading protocol, curl can "download" emails for you. With or
  110. without using TLS.
  111. .IP LDAP(S)
  112. curl can do directory lookups for you, with or without TLS.
  113. .IP MQTT
  114. curl supports MQTT version 3. Downloading over MQTT equals "subscribe" to a
  115. topic while uploading/posting equals "publish" on a topic. MQTT support is
  116. experimental and TLS based MQTT is not supported (yet).
  117. .IP POP3(S)
  118. Downloading from a pop3 server means getting a mail. With or without using
  119. TLS.
  120. .IP RTMP(S)
  121. The Realtime Messaging Protocol is primarily used to server streaming media
  122. and curl can download it.
  123. .IP RTSP
  124. curl supports RTSP 1.0 downloads.
  125. .IP SCP
  126. curl supports SSH version 2 scp transfers.
  127. .IP SFTP
  128. curl supports SFTP (draft 5) done over SSH version 2.
  129. .IP SMB(S)
  130. curl supports SMB version 1 for upload and download.
  131. .IP SMTP(S)
  132. Uploading contents to an SMTP server means sending an email. With or without
  133. TLS.
  134. .IP TELNET
  135. Telling curl to fetch a telnet URL starts an interactive session where it
  136. sends what it reads on stdin and outputs what the server sends it.
  137. .IP TFTP
  138. curl can do TFTP downloads and uploads.
  139. .SH "PROGRESS METER"
  140. curl normally displays a progress meter during operations, indicating the
  141. amount of transferred data, transfer speeds and estimated time left, etc. The
  142. progress meter displays number of bytes and the speeds are in bytes per
  143. second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024
  144. bytes. 1M is 1048576 bytes.
  145. curl displays this data to the terminal by default, so if you invoke curl to
  146. do an operation and it is about to write data to the terminal, it
  147. \fIdisables\fP the progress meter as otherwise it would mess up the output
  148. mixing progress meter and response data.
  149. If you want a progress meter for HTTP POST or PUT requests, you need to
  150. redirect the response output to a file, using shell redirect (>), --output or
  151. similar.
  152. It is not the same case for FTP upload as that operation does not spit out
  153. any response data to the terminal.
  154. If you prefer a progress "bar" instead of the regular meter, --progress-bar is
  155. your friend. You can also disable the progress meter completely with the
  156. --silent option.
  157. .SH OPTIONS
  158. Options start with one or two dashes. Many of the options require an
  159. additional value next to them.
  160. The short "single-dash" form of the options, -d for example, may be used with
  161. or without a space between it and its value, although a space is a recommended
  162. separator. The long "double-dash" form, --data for example, requires a space
  163. between it and its value.
  164. Short version options that don't need any additional values can be used
  165. immediately next to each other, like for example you can specify all the
  166. options -O, -L and -v at once as -OLv.
  167. In general, all boolean options are enabled with --\fBoption\fP and yet again
  168. disabled with --\fBno-\fPoption. That is, you use the exact same option name
  169. but prefix it with "no-". However, in this list we mostly only list and show
  170. the --option version of them. (This concept with --no options was added in
  171. 7.19.0. Previously most options were toggled on/off on repeated use of the
  172. same command line option.)