Download ZIP file with curl command

I used curl -LO and it worked fine. wget works too.


Try wget instead of curl: wget http://github.com/ziyaddin/xampp/archive/master.zip


You can use:

curl https://github.com/ziyaddin/xampp/archive/master.zip -O -J -L

Saves as: xampp-cli-master.zip

  • use -L in case there is a redirect found.
  • use -O for remote filenames (master.zip)
  • use -J (use with -O) to allow remote header filename (xampp-cli-master.zip)


Or use -o to create your own filename:

curl https://github.com/ziyaddin/xampp/archive/master.zip -L -o MyFilename.zip

Saves as: MyFilename.zip

Note: (GitHub supports SSL - use https://)


You could also use a curlrc config file or alias the CURL command to use curl -O -L to allow it to work similar to WGET.

Consult: https://curl.haxx.se/docs/manpage.html#OPTIONS (See: -O, -J, -L, -o)

Note the warning of using CURL with the -J option:

There's no attempt to decode %-sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names.

WARNING: Exercise judicious use of this option, especially on Windows. A rogue server could send you the name of a DLL or other file that could possibly be loaded automatically by Windows or some third party software.