Silencing Curl’s Progress Output
I seem to have been writing a lot of shell scripts to do things with curl lately, and the main difference with piping curl’s output to somewhere rather than just looking at it on the screen is that curl will then start outputting a whole bunch of progress information that you don’t usually see. This can be frustrating if you wanted the same output as it viewed on the command line, or (as in my case) just wanted to grep for something in the header output.
To silence the additional output, use the -s switch – but be aware that this will also silence any error messages as well! Something like this:
curl -s http://lornajane.net | grep PHP
This will enable you pass into grep just the output you would usually see on your terminal. Hope this is useful to someone!
Thanks that was useful actually.
Just what I needed, thanks!
thanks a lot
Do you know if there’s a way of silencing the progress output without silencing real errors?
Found it:
curl -s -S …
The -s silences all output, the -S un-silences errors.
Came looking for this online, and look who had helpfully blogged about it, way back when! Thanks :-)