Downloading using curl
Overview
curl
is a command-line utility for downloading files from the web. It supports downloading files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS and many other protocols. It is very similar to wget
.
Syntax
curl [options] [URL]
Basic Usage
To download a file using curl
, simply provide the URL of the file you want to download. Here's the basic command format:
curl [URL]
For example, to download a file named "example.txt" from a website, run the following command:
curl -O http://www.example.com/example.txt
The downloaded local file will be named as example.txt , note that if no filename part is specified in the URL, this command using the -O
flag will fail.
For more use cases and a detailed tutorial, please visit curl - Tutorial .
Common Options
-o --output <file>
Write to a local file instead of stdout-O --remote-name
Write output to a file named as the same as the remote file