How to disable showing progress bar using curl

September 10, 2022 No comments curl progress-bar hide bash

1. Introduction

In this article, we will show a way to not show the progress bar with curl. It can be helpful especially when we create bash scripts that automate some processes and the progress bar is not needed and even gets in the way.

2. Using the -s parameter

The -s param is used to enable silent mode. In the silent mode, the curl will not show the progress meter or error messages.

Check the following command:

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

In some cases, this is not enough. If you still see the progress bar try to redirect stderr to /dev/null:

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

You can use the S param with -s to show an error message if the request fails:

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

3. Conclusion

In this article, we presented how to execute a request using curl in silent mode.

{{ message }}

{{ 'Comments are closed.' | trans }}