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, 743 Views

Hey! Yeah, the `>` thing can be weird in Windows CMD. Try using `-o` instead—it’s more reliable for curl output to a file in windows. Like this:

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

For appending, `-o` won’t help, but `>>` *should* work in CMD. If it’s not, maybe check if your curl version is up to date?

Also, PowerShell handles this better IMO. You could try:
`curl https://example.com | Out-File -FilePath output.txt -Append`

Hope that helps!

Messages In This Thread



Users browsing this thread: 1 Guest(s)