I am running Mac OS 10.11.6 El Capitan. There is a link I would like to download programmatically:
If I paste this URL into any browser (e.g. Safari) the download works perfectly.
However, if I try to download the same URL from the command line using
curl, it doesn't work—the result is an empty file:
$ ls -lA $ curl -O https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.16-osx10.11-x86_64.dmg % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 $ ls -lA total 0 -rw-r--r-- 1 myname staff 0 Nov 7 14:07 mysql-5.7.16-osx10.11-x86_64.dmg $
Of course I can get the file through the browser, but I would like to understand why the
curl command above doesn't work.
curl download this file correctly, when it is evidently present on the website and can be correctly accessed and downloaded through a graphical web browser?