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