cURL vs Wget: Key Differences Explained
curl and wget are both popular terminal tools but often used for different tasks - let's take a look at the differences.
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:
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:
% 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:
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.
This knowledgebase is provided by Scrapfly data APIs, check us out! 👇