curl(1) 2007-03-03 curl(1) NNAAMMEE curl - transfer a URL SSYYNNOOPPSSIISS curl [options] [URL...] DDEESSCCRRIIPPTTIIOONN curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction. curl offers a busload of useful tricks like proxy support, user authen- tication, ftp upload, HTTP post, SSL (https:) connections, cookies, file transfer resume and more. As you will see below, the amount of features will make your head spin! curl is powered by libcurl for all transfer-related features. See _l_i_b_c_u_r_l_(_3_) for details. URL The URL syntax is protocol dependent. You'll find a detailed description in RFC 3986. You can specify multiple URLs or parts of URLs by writing part sets within braces as in: http://site.{one,two,three}.com or you can get sequences of alphanumeric series by using [] as in: ftp://ftp.numericals.com/file[1-100].txt ftp://ftp.numericals.com/file[001-100].txt (with leading zeros) ftp://ftp.letters.com/file[a-z].txt No nesting of the sequences is supported at the moment, but you can use several ones next to each other: http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html You can specify any amount of URLs on the command line. They will be fetched in a sequential manner in the specified order. Since curl 7.15.1 you can also specify step counter for the ranges, so that you can get every Nth number or letter: http://www.numericals.com/file[1-100:10].txt http://www.letters.com/file[a-z:2].txt If you specify URL without _p_r_o_t_o_c_o_l_:_/_/ prefix, curl will attempt to guess what protocol you might want. It will then default to HTTP but try other protocols based on often-used host name prefixes. For exam- ple, for host names starting with "ftp." curl will assume you want to speak FTP. Curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple con- nects / handshakes. This improves speed. Of course this is only done on files specified on a single command line and cannot be used between separate curl invokes. PPRROOGGRREESSSS MMEETTEERR curl normally displays a progress meter during operations, indicating amount of transfered data, transfer speeds and estimated time left etc. However, since curl displays data to the terminal by default, if you invoke curl to do an operation and it is about to write data to the terminal, it disables the progress meter as otherwise it would mess up the output mixing progress meter and response data. If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, using shell redirect (>), --oo [[ffiillee]] or similar. It is not the same case for FTP upload as that operation is not spit- ting out any response data to the terminal. If you prefer a progress "bar" instead of the regular meter, --## is your friend. OOPPTTIIOONNSS --aa//----aappppeenndd (FTP) When used in an FTP upload, this will tell curl to append to the target file instead of overwriting it. If the file doesn't exist, it will be created. If this option is used twice, the second one will disable append mode again. --AA//----uusseerr--aaggeenntt ""aaggeenntt ssttrriinngg"" (HTTP) Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if its not set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks. This can also be set with the --HH//----hheeaaddeerr option of course. If this option is set more than once, the last one will be the one that's used. FFIILLEESS ~~//..ccuurrllrrcc Default config file, see --KK//----ccoonnffiigg for details. EENNVVIIRROONNMMEENNTT http_proxy [protocol://][:port] Sets proxy server to use for HTTP. HTTPS_PROXY [protocol://][:port] Sets proxy server to use for HTTPS. FTP_PROXY [protocol://][:port] Sets proxy server to use for FTP. ALL_PROXY [protocol://][:port] Sets proxy server to use if no protocol-specific proxy is set. NO_PROXY list of host names that shouldn't go through any proxy. If set to a asterisk '*' only, it matches all hosts. EEXXIITT CCOODDEESS There exists a bunch of different error codes and their corresponding error messages that may appear during bad conditions. At the time of this writing, the exit codes are: "1" Unsupported protocol. This build of curl has no support for this pro- tocol. 2 Failed to initialize. 3 URL malformat. The syntax was not correct. SSEEEE AALLSSOO ftp(1) wget(1) AAUUTTHHOORRSS Daniel Stenberg is the main author, but the whole list of contributors is found in the separate THANKS file. Curl homepage is at http://curl.haxx.se and the FTP access link is ftp://ftp.sunet.se/pub/www/utilities/curl/ curl 2007-03-03 curl(1)