Downloading Files Using curl Command
curl
is also widely used for downloading files from the internet. To download a file, you simply provide the URL of the file as an argument:
-o: saves the downloaded file on the local machine with the name provided in the parameters.
Syntax:
curl -o [file_name] [URL...]
Example:
curl -o hello.zip ftp://speedtest.tele2.net/1MB.zip
Output:
The above example downloads the file from the FTP server and saves it with the name hello.zip.
-O: This option downloads the file and saves it with the same name as in the URL.
Syntax:
curl -O [URL...]
Example:
curl -O ftp://speedtest.tele2.net/1MB.zip
Output:
curl Command in Linux with Examples
In the realm of Linux, mastering the command line is essential for efficient and powerful usage of the operating system. Among the number of command line tools available, `curl`
stands out as one of the most versatile and powerful utilities. Originally developed by Daniel Stenberg, `curl`
is a command-line tool and library for transferring data with URLs. It supports a wide range of protocols, making it an invaluable tool for fetching, uploading, and managing data over the Internet. In this comprehensive guide, we delve into the intricacies of the `curl`
command in Linux, exploring its features, options, and various use cases.