Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
LemonWiki共筆
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Troubleshooting of curl errors
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== How to Suppress the Progress Meter === When executing the curl command, the typical output includes detailed information about the download and upload process as shown below: <pre> % curl -o sample.pdf https://example.com/sample.pdf % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 90141 100 90141 0 0 20029 0 0:00:04 0:00:04 --:--:-- 22012 </pre> 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> curl -sSo file.pdf [URL] </pre> Alternatively, if you prefer to suppress all output including error messages, use the {{kbd | key=<nowiki>-s</nowiki>}} (silent) option alone: <pre> curl -so file.pdf [URL] </pre> Suggestion: <pre> curl -sSfo file.pdf [URL] </pre> Adding {{kbd | key=<nowiki>-f</nowiki>}} causes curl to fail on HTTP errors (4xx, 5xx), making it the most robust option for scripts. <table class="wikitable sortable"> <tr> <th>Flag</th> <th>Error type caught</th> </tr> <tr> <td><span class="flag">-S</span></td> <td>Network-level errors (DNS failure, connection refused)</td> </tr> <tr> <td><span class="flag">-f</span></td> <td>HTTP-level errors (4xx, 5xx)</td> </tr> <tr> <td><span class="flag">-sS</span></td> <td>Silent + network errors</td> </tr> <tr> <td><span class="flag">-sSf</span></td> <td>Silent + network errors + HTTP errors</td> </tr> </table>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki共筆:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)