I have a JAR that is available for download from an HTTP URL, say, http://somerepo.example.org/myjar-1.0.jar
.
I need a cURL command that will download it to
You are almost there. By default cURL will output the download to STDOUT. You want to redirect this to a file like so:
curl -H "Accept: application/zip" http://somerepo.example.org/myjar-1.0.jar > myfile.jar
You can also use the -o
option:
curl -H "Accept: application/zip" http://somerepo.example.org/myjar-1.0.jar -o myfile.jar
You should also be able to use wget
wget http://somerepo.example.org/myjar-1.0.jar