Is there an option for the curl command to show only a percentage output to shell rather than all of this, for example:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.4M 100 12.4M 0 0 4489k 0 0:00:02 0:00:02 --:--:-- 4653k
Maybe there is a flag I can set? If not, pipe it somehow through a regular expression to show me a continuous update of the percentage only?
Thanks all
The procedure to hide curl progress bar is to pass the -s or --silent option to the curl command: Open the terminal application on your Linux/Unix. Type the command (pass -s option to curl to hide progress bar): $ curl -s https://your-dot-com-domain-name-here/ > /tmp/output.
curl features an alternative progress bar. When you invoke it with -# or the longer version –progress-bar, curl will show the transfer progress using a single “bar” on the screen instead of the default meter that shows a lot of data like amount of data, transfer speeds and times.
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.
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.
Two modifiers might help, although neither are exact: --silent
will suppress all updates and --progress-bar
will show a progress bar only.
Edit: One option to make things easier would be to make a wrapper using Expect to simplify the output to your shell script or whatever is listening to curl.
Does the parameter -#
solve your problem?
-#/--progress-bar
Make curl display progress information as a progress bar instead of the default statistics.
From here.
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