This article explains how to download a file using curl command. The curl command is a versatile command-line tool used to transfer data to or from a server.
Follow the steps-
- Retrieve the file using curl run-
$ curl https://your-domain/file.pdf - Get file using ftp or sftp protocol-
$ curl ftp://ftp-your-domain-name/file.tar.gz - While using curl to download a file, you can specify the desired output file name by running-
$ curl -o file.pdf https://your-domain-name/long-file-name.pdf - To follow a 301-redirected file during a file download using curl, use the following command-
$ curl -L -o file.tgz http://www.cyberciti.biz/long.file.name.tgz
This way, you can download a file using curl command. If you face any difficulty while executing these commands, you can seek help from our experts at any time.