Create local directories automatically for output paths.
Section: Downloads
Create local directories
bash
bash
curl --create-dirs -o downloads/reports/out.pdf https://example.com/report.pdfExplanation
Handy when writing into nested destination paths.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Downloads
Save using Content-Disposition filename
Use server-provided filename from headers.
URL globbing with lists
Download several related URLs using brace expansion.
Retry on all errors
Retry on all errors, including transient HTTP failures when appropriate.