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.
The curl command with the -o /dev/null option can be used to suppress the response body output. Something like this should be displayed. If you also want to supress the progress bar, the -s or --silent flag can be used. Now the curl command returns no output.
Using Curl Options to Allow GrepThe --stderr option in curl allows you to redirect the standard error (STDERR) to a file. If you specify the filename as - (a single dash) the output will be written to standard output. This allows you to pipe it to grep without any shell redirection.
To specify the transfer rate using curl command in Linux The curl option also provides the option to limit the data transfer rate. The values can be described in bytes, kilobytes, megabytes or gigabytes having the suffix k,m, or g respectively. '–limit-rate' option is used to specify the transfer rate.
What is a flag in Curl? A flag is a command-line parameter that denotes a specific action in Curl. Curl has over three hundred command-line options, and the number of options increases over time. You can add the listed flags to the Curl command and enter the URL.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With