| 1 |
.\" ************************************************************************** |
| 2 |
.\" * _ _ ____ _ |
| 3 |
.\" * Project ___| | | | _ \| | |
| 4 |
.\" * / __| | | | |_) | | |
| 5 |
.\" * | (__| |_| | _ <| |___ |
| 6 |
.\" * \___|\___/|_| \_\_____| |
| 7 |
.\" * |
| 8 |
.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <[email protected]>, 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 |
.\" 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, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET |
| 35 |
and TFTP). The command is designed to work without user interaction. |
| 36 |
|
| 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 |
|
| 42 |
curl is powered by libcurl for all transfer-related features. See |
| 43 |
\fIlibcurl(3)\fP for details. |
| 44 |
.SH URL |
| 45 |
The URL syntax is protocol-dependent. You'll find a detailed description in |
| 46 |
RFC 3986. |
| 47 |
|
| 48 |
You can specify multiple URLs or parts of URLs by writing part sets within |
| 49 |
braces as in: |
| 50 |
|
| 51 |
http://site.{one,two,three}.com |
| 52 |
|
| 53 |
or you can get sequences of alphanumeric series by using [] as in: |
| 54 |
|
| 55 |
ftp://ftp.example.com/file[1-100].txt |
| 56 |
|
| 57 |
ftp://ftp.example.com/file[001-100].txt (with leading zeros) |
| 58 |
|
| 59 |
ftp://ftp.example.com/file[a-z].txt |
| 60 |
|
| 61 |
Nested sequences are not supported, but you can use several ones next to each |
| 62 |
other: |
| 63 |
|
| 64 |
http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html |
| 65 |
|
| 66 |
You can specify any amount of URLs on the command line. They will be fetched |
| 67 |
in a sequential manner in the specified order. You can specify command line |
| 68 |
options and URLs mixed and in any order on the command line. |
| 69 |
|
| 70 |
You can specify a step counter for the ranges to get every Nth number or |
| 71 |
letter: |
| 72 |
|
| 73 |
http://example.com/file[1-100:10].txt |
| 74 |
|
| 75 |
http://example.com/file[a-z:2].txt |
| 76 |
|
| 77 |
When using [] or {} sequences when invoked from a command line prompt, you |
| 78 |
probably have to put the full URL within double quotes to avoid the shell from |
| 79 |
interfering with it. This also goes for other characters treated special, like |
| 80 |
for example '&', '?' and '*'. |
| 81 |
|
| 82 |
Provide the IPv6 zone index in the URL with an escaped percentage sign and the |
| 83 |
interface name. Like in |
| 84 |
|
| 85 |
http://[fe80::3%25eth0]/ |
| 86 |
|
| 87 |
If you specify URL without protocol:// prefix, curl will attempt to guess what |
| 88 |
protocol you might want. It will then default to HTTP but try other protocols |
| 89 |
based on often-used host name prefixes. For example, for host names starting |
| 90 |
with "ftp." curl will assume you want to speak FTP. |
| 91 |
|
| 92 |
curl will do its best to use what you pass to it as a URL. It is not trying to |
| 93 |
validate it as a syntactically correct URL by any means but is instead |
| 94 |
\fBvery\fP liberal with what it accepts. |
| 95 |
|
| 96 |
curl will attempt to re-use connections for multiple file transfers, so that |
| 97 |
getting many files from the same server will not do multiple connects / |
| 98 |
handshakes. This improves speed. Of course this is only done on files |
| 99 |
specified on a single command line and cannot be used between separate curl |
| 100 |
invokes. |
| 101 |
.SH "PROGRESS METER" |
| 102 |
curl normally displays a progress meter during operations, indicating the |
| 103 |
amount of transferred data, transfer speeds and estimated time left, etc. The |
| 104 |
progress meter displays number of bytes and the speeds are in bytes per |
| 105 |
second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024 |
| 106 |
bytes. 1M is 1048576 bytes. |
| 107 |
|
| 108 |
curl displays this data to the terminal by default, so if you invoke curl to |
| 109 |
do an operation and it is about to write data to the terminal, it |
| 110 |
\fIdisables\fP the progress meter as otherwise it would mess up the output |
| 111 |
mixing progress meter and response data. |
| 112 |
|
| 113 |
If you want a progress meter for HTTP POST or PUT requests, you need to |
| 114 |
redirect the response output to a file, using shell redirect (>), --output or |
| 115 |
similar. |
| 116 |
|
| 117 |
It is not the same case for FTP upload as that operation does not spit out |
| 118 |
any response data to the terminal. |
| 119 |
|
| 120 |
If you prefer a progress "bar" instead of the regular meter, --progress-bar is |
| 121 |
your friend. You can also disable the progress meter completely with the |
| 122 |
--silent option. |
| 123 |
.SH OPTIONS |
| 124 |
Options start with one or two dashes. Many of the options require an |
| 125 |
additional value next to them. |
| 126 |
|
| 127 |
The short "single-dash" form of the options, -d for example, may be used with |
| 128 |
or without a space between it and its value, although a space is a recommended |
| 129 |
separator. The long "double-dash" form, --data for example, requires a space |
| 130 |
between it and its value. |
| 131 |
|
| 132 |
Short version options that don't need any additional values can be used |
| 133 |
immediately next to each other, like for example you can specify all the |
| 134 |
options -O, -L and -v at once as -OLv. |
| 135 |
|
| 136 |
In general, all boolean options are enabled with --\fBoption\fP and yet again |
| 137 |
disabled with --\fBno-\fPoption. That is, you use the exact same option name |
| 138 |
but prefix it with "no-". However, in this list we mostly only list and show |
| 139 |
the --option version of them. (This concept with --no options was added in |
| 140 |
7.19.0. Previously most options were toggled on/off on repeated use of the |
| 141 |
same command line option.) |