Linux / Unix curl Command Download File Example

The curl command is a powerful tool for transferring data from or to a server over various protocols, including HTTP, HTTPS, FTP, and many others. To download a file from a remote server using curl, you can use the following syntax:

curl [options] [URL] -o [filename]

For example, to download a file named example.txt from the URL http://example.com/example.txt and save it as example_file.txt on your local system, you can use the following command:

curl http://example.com/example.txt -o example_file.txt

You can also use options to control the behavior of the curl command. For example, you can use the -L option to follow redirects, the -O option to save the file using the original file name, or the -s option to run curl in silent mode and suppress output messages.

For more information on the options and features of the curl command, you can refer to its manual page by running man curl in the terminal.

(www.traveltalktours.com)

Leave a Comment