How do I save curl output to a file in Windows? or What's the best way to redirect curl output to a f

12 Replies, 740 Views

Pro tip: Use `-L` with `-o` if the URL redirects. Sometimes curl output to a file in windows fails ’cause it doesn’t follow redirects.

Example:
`curl -L https://example.com -o output.txt`

For appending, `>>` is correct in CMD, but yeah, PowerShell’s `Out-File -Append` is more reliable.

If you’re dealing with JSON or APIs, jq (https://stedolan.github.io/jq/) is a lifesaver for formatting output before saving.

Messages In This Thread



Users browsing this thread: 1 Guest(s)