Skip to main content
add the -f flag
Source Link
ahilsend
  • 1.5k
  • 11
  • 8

What about -sSsSf? From the man pages:

  -s/--silent
     Silent or quiet mode. Do not show progress meter or error messages.  
     Makes Curl mute.

  -S/--show-error
     When used with -s it makes curl show an error message if it fails.

  -f/--fail
     (HTTP)  Fail silently (no output at all) on server errors. This is mostly
     done to better enable scripts etc to better deal with failed attempts. In
     normal  cases  when a HTTP server fails to deliver a document, it returns
     an HTML document stating so (which often also describes  why  and  more).
     This flag will prevent curl from outputting that and return error 22.

     This method is not fail-safe and there are occasions where non-successful
     response codes will  slip  through,  especially  when  authentication  is
     involved (response codes 401 and 407).

For example:

  curl -s/--silent
      Silent or quiet mode. Don't show progress meter or error messages.  Makes
      CurlsSf mutehttp://example.

 org > -S/--show-error
      When used with -s it makes curl show an error message if it fails.dev/null

What about -sS? From the man pages:

   -s/--silent
      Silent or quiet mode. Don't show progress meter or error messages.  Makes
      Curl mute.

   -S/--show-error
      When used with -s it makes curl show an error message if it fails.

What about -sSf? From the man pages:

  -s/--silent
     Silent or quiet mode. Do not show progress meter or error messages.  
     Makes Curl mute.

  -S/--show-error
     When used with -s it makes curl show an error message if it fails.

  -f/--fail
     (HTTP)  Fail silently (no output at all) on server errors. This is mostly
     done to better enable scripts etc to better deal with failed attempts. In
     normal  cases  when a HTTP server fails to deliver a document, it returns
     an HTML document stating so (which often also describes  why  and  more).
     This flag will prevent curl from outputting that and return error 22.

     This method is not fail-safe and there are occasions where non-successful
     response codes will  slip  through,  especially  when  authentication  is
     involved (response codes 401 and 407).

For example:

curl -sSf http://example.org > /dev/null
Source Link
ahilsend
  • 1.5k
  • 11
  • 8

What about -sS? From the man pages:

   -s/--silent
      Silent or quiet mode. Don't show progress meter or error messages.  Makes
      Curl mute.

   -S/--show-error
      When used with -s it makes curl show an error message if it fails.