<\/span><\/h2>\r\n\r\n\r\n\r\nYou can download files with cURL by adding the -O option to the command. It is used for saving files on the local server with the same names as on the remote server:<\/p>\r\n\r\n\r\n\r\n
curl -O https:\/\/domain.com\/file.zip<\/pre>\r\n\r\n\r\n\r\nIn this example, the ‘file.zip’ zip archive will be downloaded to the current working directory.<\/p>\r\n\r\n\r\n\r\n
You can also download the file with a different name by adding the -o option to cURL:<\/p>\r\n\r\n\r\n\r\n
curl -o archive.zip https:\/\/domain.com\/file.zip<\/pre>\r\n\r\n\r\n\r\nThis way the ‘file.zip’ archive will be downloaded and saved as ‘archive.zip’.<\/p>\r\n\r\n\r\n\r\n
cURL can also be used to download multiple files simultaneously, as shown in the example below:<\/p>\r\n\r\n\r\n\r\n
curl -O https:\/\/domain.com\/file.zip -O https:\/\/domain.com\/file2.zip<\/pre>\r\n\r\n\r\n\r\ncURL can be also used to download files securely via SSH using the following command:<\/p>\r\n\r\n\r\n\r\n
curl -u user sftp:\/\/server.domain.com\/path\/to\/file<\/pre>\r\n\r\n\r\n\r\nNote that you have to use the full path of the file you want to download.<\/p>\r\n\r\n\r\n\r\n