How to save the output of a cURL request to a file?

To save the output of a cURL request to a file, you can use the "-o" or "--output" option followed by the desired filename. Here's an example:

curl -o output.txt http://example.com

This command will save the output of the cURL request to a file named "output.txt". If the file already exists, it will be overwritten. If you want to append the output to a file instead of overwriting it, you can use the "-a" or "--append" option:

curl -a -o output.txt http://example.com

This command will append the output to the end of the "output.txt" file.