If you have a use case where you want to hide what is outputted on the Terminal when you run a cURL request, then you would have to do a combination of steps.
Example 1: Hide the Progress Meter
If you do not want to see the progress details then make use of the option --no-progress-meter
Example: With Progress Meter% curl -o sample.html http://example.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1256 100 1256 0 0 2868 0 --:--:-- --:--:-- --:--:-- 2907
Example: Without Progress Meter
% curl -o sample.html --no-progress-meter http://example.com
%
![cURL with option to hide progress meter cURL with option to hide progress meter](https://code2care.org/howto/hide-curl-outputs-errors-on-terminal/images/cURL with option to hide progress meter.jpg)
As you can see using --no-progress-meter you do not see the meter and the file is saved without any output on the console.
Example 2: Hide outputs using --silent or -s option
-s or --silent is a flag you can use with cURL to execute your request in quiet mode, it will not show the progress meter or any error messages on the console.
% curl -s -o sample.html http://example.com
![Silent option with cURL to hide output Silent option with cURL to hide output](https://code2care.org/howto/hide-curl-outputs-errors-on-terminal/images/Scilent option with cURL to hide output.jpg)
Note: Make use of --show-error with -s option to disable the progress meter but to display error messages.
Example 3: Hide all cURL Request Outputs
If you do not want to display any output text be it progress, output data, or error messages then you will need to make use of the combination of --silent and redirect the output to /dev/null
Example:% curl --silent http://example.com > /dev/null
Example:
% curl -s -o /dev/null http://example.com
![Do not show any text in output cURL Do not show any text in output cURL](https://code2care.org/howto/hide-curl-outputs-errors-on-terminal/images/Do not show any text in output cURL.jpg)
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- Capture cURL Request Output to a File
- Fix: Curl No Match Found Error
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- Send JSON Data as Payload using cURL HTTP POST Request
- cURL: Show Request and Response Headers
- Get cURL command from Chrome Inspect Network HTTP URL
- Save cURL Command Output to a external file
- cURL DELETE Request with Examples
- How to URL Encode Data for a cURL Request Parameters
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to convert a Postman request to cURL Command
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- How to follow redirects in cURL Command Request
- How to pass authorization header using cURL
- cURL -x Use of HTTP Proxy Server Examples
- Downloading Google Chrome using cURL Command
- How to get cURL Command to run in verbose mode?
- List of 28 Protocols supported by cURL with Examples
- Hide cURL Outputs and Errors on Terminal
- cURL -d Option with Examples
- How to show SSL Certificate details using cURL Command
- Perform Basic Authentication using cURL with Examples
- Update All Outdated Modules/Packages using pip3 - PIP
- How to SFTP to port different than 22 (SFTP Custom port) - FTP
- Convert JSON to Java Collection Map using Jackson - Java
- How to retrieve all SharePoint Online List Items using Rest API - SharePoint
- MySQL Workbench could not detect any MySQL server running. This means that MySQL is not installed or is not running. - MySQL
- [docker] Error response from daemon: No such container - Docker
- Share image and text Twitter using your Android Application Programatically - Twitter
- Microsoft Office Excel - Couldnt Open the Workbook - The workbook cannot be opened. - Microsoft