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

If you’re stuck with CMD, try this:

`curl https://example.com --output output.txt --no-buffer`

The `--no-buffer` flag can help with weird encoding issues. For appending, `>>` *should* work, but if it doesn’t, maybe your shell’s wonky.

Also, check if your anti-virus is blocking file writes—sounds dumb, but it happens.

---

Thanks for all the tips, everyone! I tried the `-o` flag, and it worked perfectly. Still figuring out the appending part—PowerShell’s `Out-File -Append` seems to do the trick, but CMD’s `>>` is hit or miss.

Weirdly, the encoding issue went away when I switched to Git Bash. Maybe CMD just hates me lol.

Anyone know why `>>` behaves differently in CMD vs. PowerShell? Is it a buffer thing?

Messages In This Thread



Users browsing this thread: 1 Guest(s)