🚀 We are hiring! See open positions

How To Download a File With cURL?

by Mazen Ramadan Mar 05, 2025 1 min read

To download a file with cURL, we can use the -O option. Let's attempt to download a PDF file on web-scraping.dev with cURL:

shell
curl -O https://web-scraping.dev/assets/pdf/eula.pdf

The above command will result in the following output and save the file to the same directory of the opened terminal:

shell
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10287  100 10287    0     0  10769      0 --:--:-- --:--:-- --:--:-- 10783

Next, let's download a file with cURL to a specific folder location with the --output-dir cURL option:

shell
curl --create-dirs -O --output-dir /eula/pdfs https://web-scraping.dev/assets/pdf/eula.pdf

The above cURL command will download the PDf file and save it to the /eula/pdfs directory. For further details on cURL, refer to our dedicated guide.

Scale Your Web Scraping
Anti-bot bypass, browser rendering, and rotating proxies — all in one API. Start with 1,000 free credits.
No credit card required 1,000 free API credits Anti-bot bypass included
Not ready? Get our newsletter instead.