Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 4
    -sS didn't output the error message for some reason. I had to add -f also. The correct working command seems to be curl -fsS http://example.org > /dev/null. That will not output anything when nothing is wrong but it will print the status code on errors which is fine by me. Commented Jul 29, 2013 at 15:50
  • 2
    Ok, added -f for future references. Commented Jul 29, 2013 at 16:08
  • I added echo to so that I know the connection was successful. curl -sSf http://example.org > /dev/null && echo "success" Commented Mar 15, 2022 at 11:57
  • Thanks. Found this helpful. How about throwing in a -L to follow redirects? Commented Dec 5, 2022 at 14:37