I'm trying to get curl, using a script, to download a file and save it to a certain directory. I got it to download but I dont know how to get it to a certain directory from a script. It usually just saves it to the current working directory.

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted
curl http://google.com > /path/to/dir/index.html
link|improve this answer
feedback

Let curl and the shell each do what they do well:

(cd TARGET_DIRECTORY && curl ...)

Also there may be things that interest you in the description of the -o option in the manual.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown