14,958
edits
| Line 408: | Line 408: | ||
To suppress the progress meter of the curl command, you can use the {{kbd | key=<nowiki>-s</nowiki>}} (silent) option, which hides all output, or the {{kbd | key=<nowiki>-S</nowiki>}} (silent with error messages) option, which suppresses the progress meter but still displays error messages. | To suppress the progress meter of the curl command, you can use the {{kbd | key=<nowiki>-s</nowiki>}} (silent) option, which hides all output, or the {{kbd | key=<nowiki>-S</nowiki>}} (silent with error messages) option, which suppresses the progress meter but still displays error messages. | ||
<pre> | <pre> | ||
curl - | curl -sSo file.pdf [URL] | ||
</pre> | </pre> | ||
Alternatively, if you prefer to suppress all output including error messages, use the {{kbd | key=<nowiki>-s</nowiki>}} (silent) option alone: | Alternatively, if you prefer to suppress all output including error messages, use the {{kbd | key=<nowiki>-s</nowiki>}} (silent) option alone: | ||
<pre> | <pre> | ||
curl - | curl -so file.pdf [URL] | ||
</pre> | </pre> | ||
Suggestion: | Suggestion: | ||
<pre> | <pre> | ||
curl - | curl -sSfo file.pdf [URL] | ||
</pre> | </pre> | ||
Adding {{kbd | key=<nowiki>-f</nowiki>}} causes curl to fail on HTTP errors (4xx, 5xx), making it the most robust option for scripts. | Adding {{kbd | key=<nowiki>-f</nowiki>}} causes curl to fail on HTTP errors (4xx, 5xx), making it the most robust option for scripts. | ||