We are downloading several large files with cURL
.
curl -O -L -k "https://www.modern.ie/vmdownload?browserOS=IE8-Win7&parts=4&platform=Windows&virtPlatform=vpc&filename=VMBuild_20141027/VPC/IE8/Windows/IE8.Win7.For.Windows.VPC.zip{.001,.002,.003,.004}"
Where do the downloads land?
Our command prompt is at C:\WINDOWS\system32\cmd.exe
. When I look through that directory, I don't find the downloaded file, which I would expect to be IE8.Win7.For.Windows.VPC.zip.001
. This is the cURL output.
[1/4]: https://the-long-url/IE8.Win7.For.Windows.VPC.zip.001
--> IE8.Win7.For.Windows.VPC.zip.001
--_curl_--https://the-long-url/IE8.Win7.For.Windows.VPC.zip.001
Palu said, "the download will go to the current working directory for when this was executed." Why isn't it there?
Why isn't it there? Because although we were running C:\WINDOWS\system32\cmd.exe
, we were running it from C:\Users\shaun.luttin
.
In this case, the download will go to the current working directory for when this was executed.
From The curl Man Page
-o, --output <file>
Write output to instead of stdout. If you are using {} or [] to fetch multiple documents, you can use '#' followed by a number in the specifier. That variable will be replaced with the current string for the URL being fetched. Like in:
curl http://{one,two}.site.com -o "file_#1.txt"
or use several variables like:
curl http://{site,host}.host[1-5].com -o "#1_#2"
You may use this option as many times as the number of URLs you have.
See also the --create-dirs option to create the local directories dynamically. Specifying the output as '-' (a single dash) will force the output to be done to stdout.
-O, --remote-name
Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.)
The remote file name to use for saving is extracted from the given URL, nothing else.
Consequentially, the file will be saved in the current working directory. If you want the file saved in a different directory, make sure you change current working directory before you invoke curl with the -O, --remote-name flag!
There is no URL decoding done on the file name. If it has %20 or other URL encoded parts of the name, they will end up as-is as file name.
You may use this option as many times as the number of URLs you have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With