How to capture Curl output to a file?

Tony picture Tony · Dec 6, 2012 · Viewed 636.9k times · Source

I have a text document that contains a bunch of URLs in this format:

URL = "sitehere.com"

What I'm looking to do is to run curl -K myfile.txt, and get the output of the response Curl returns, into a file.

How can I do this?

Answer

Alex2php picture Alex2php · Dec 6, 2012
curl -K myconfig.txt -o output.txt 

Writes the first output received in the file you specify (overwrites if an old one exists).

curl -K myconfig.txt >> output.txt

Appends all output you receive to the specified file.

Note: The -K is optional.