curl hide progress bar output on Linux/Unix shell scripts

I am a new Ubuntu Linux user. I am writing a shell script and using the curl command to grab URL output using curl$key/hash.html. However, the curl command is outputting complete progress information that my script does not need it. How can I get curl command not to show the progress bar output? How can I hide curl command output? Is there is a simple way for silencing curl’s progress output on an Ubuntu Linux desktop?

Introduction: cUrl is both an application library and command for downloading files or performing requests on the Web. The curl command works on Linux, Windows, macOS, *BSD and Unix-like system. This page shows how to hide progress bar output on a Linux or Unix-like system when using the curl command.


curl hide progress bar output when using shell scripts

The procedure to hide curl progress bar is to pass the -s or --silent option to the curl command:

  1. Open the terminal app
  2. Type the command: curl -s > /tmp/output.html
  3. Verify it with the cat command: cat /tmp/output.html

Let us see all commands and some examples in details.

How can I get cURL not show the progress bar on Linux

Consider the following simple command:
$ curl > /tmp/output.html
How to get cURL command not show the progress bar

How to silencing curl command’s progress output

Run command:
$ curl -s > /tmp/output.html
$ curl --silent > /tmp/output.html
You can use the grep command or egrep command as follows too:
$ curl -s | grep -A 2 '<td id="latest_button">'
Silencing Curl Command's Progress Bar Output

Understanding the -s and -S options

From the curl man page:

The -s or --silent option act as silent or quiet mode. Don’t show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.

Use -S, --show-error in addition to this option to disable progress meter but still show error messages.

The following command will silence the progress output without silencing real errors:
$ curl -sS > /tmp/out.txt
$ curl -sS > /dev/null

Eliminating progress bar on an older version of curl running on Unix-like system

If you are using an older version of curl and cannot update curl that has -s option, try:
$ curl 2>/dev/null > /tmp/nix.html
$ curl 2>/dev/null | grep '<title>'
curl hide progress bar output on Linux macOS BSD Unix


You just learned how to eliminating curl command’s progress bar output when using with shell scripts. For more info see curl command man page.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.