Read more

Disable output when using cURL

Arne Hartherz
September 15, 2011Software engineer at makandra GmbH

cURL makes a web request and shows you the response body.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

You can redirect the response body to /dev/null just like for many other programs. But if you do that, cURL will display some short information about the request you are making:

$ curl http://www.example.com/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 30865  100 30865    0     0   4793      0  0:00:06  0:00:06 --:--:-- 10199

If you want no output at all (for example for cronjobs), add the --silent switch:

curl --silent http://www.example.com/ > /dev/null
Posted by Arne Hartherz to makandra dev (2011-09-15 16:15)