How do I get cURL to not show the progress bar?

LinuxBashUnixScriptingCurl

Linux Problem Overview


I'm trying to use cURL in a script and get it to not show the progress bar.

I've tried the -s, -silent, -S, and -quiet options, but none of them work.

Here's a typical command I've tried:

curl -s http://google.com > temp.html

I only get the progress bar when pushing it to a file, so curl -s http://google.com doesn't have a progress bar, but curl -s http://google.com > temp.html does.

Linux Solutions


Solution 1 - Linux

curl -s http://google.com > temp.html

works for curl version 7.19.5 on Ubuntu 9.10 (no progress bar). But if for some reason that does not work on your platform, you could always redirect stderr to /dev/null:

curl  http://google.com 2>/dev/null > temp.html

Solution 2 - Linux

In curl version 7.22.0 on Ubuntu and 7.24.0 on OSX the solution to not show progress but to show errors is to use both -s (--silent) and -S (--show-error) like so:

curl -sS http://google.com > temp.html

This works for both redirected output > /some/file, piped output | less and outputting directly to the terminal for me.

Update: Since curl 7.67.0 there is a new option --no-progress-meter which does precisely this and nothing else, see clonejo's answer for more details.

Solution 3 - Linux

I found that with curl 7.18.2 the download progress bar is not hidden with:

curl -s http://google.com > temp.html

but it is with:

curl -ss http://google.com > temp.html

Solution 4 - Linux

Since curl 7.67.0 (2019-11-06) there is --no-progress-meter, which does exactly this, and nothing else. From the man page:

> --no-progress-meter > Option to switch off the progress meter output without muting or > otherwise affecting warning and informational messages like -s, > --silent does. > > Note that this is the negated option name documented. You can > thus use --progress-meter to enable the progress meter again. > > See also -v, --verbose and -s, --silent. Added in 7.67.0.

It's available in Ubuntu ≥20.04 and Debian ≥11 (Bullseye).

For a bit of history on curl's verbosity options, you can read Daniel Stenberg's blog post.

Solution 5 - Linux

Not sure why it's doing that. Try -s with the -o option to set the output file instead of >.

Solution 6 - Linux

On macOS 10.13.6 (High Sierra), the -sS option works. It is especially useful inside Perl, in a command like curl -sS --get {someURL}, which frankly is a whole lot more simple than any of the LWP or HTTP wrappers, for just getting a website or web page's contents.

Solution 7 - Linux

this could help..

curl 'http://example.com' > /dev/null

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionadammengesView Question on Stackoverflow
Solution 1 - LinuxunutbuView Answer on Stackoverflow
Solution 2 - LinuxchmacView Answer on Stackoverflow
Solution 3 - LinuxBill HealeyView Answer on Stackoverflow
Solution 4 - LinuxclonejoView Answer on Stackoverflow
Solution 5 - LinuxTom ZychView Answer on Stackoverflow
Solution 6 - LinuxRLynch59View Answer on Stackoverflow
Solution 7 - LinuxVivek GulatiView Answer on Stackoverflow