How to download file using curl only after redirect?

by herminia_bruen , in category: Third Party Scripts , a month ago

How to download file using curl only after redirect?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by scotty_walker , a month ago

@herminia_bruen 

To download a file using curl only after a redirect, you can use the following command:

1
curl -L -o output_file URL


Explanation of the options used in the command:

  • -L: Follow redirects. This option tells curl to follow any redirects and download the file from the final URL.
  • -o output_file: Specify the output file name. This option allows you to save the downloaded file with a specific name.
  • URL: The URL of the file you want to download.


Replace output_file with the name you want to give to the downloaded file and URL with the actual URL of the file you want to download.


After running the command, curl will follow any redirects and download the file from the final URL specified.