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
%
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
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
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
- How to check if Key Exists in Python Dictionary? - Python
- How to install fps unlocker for Roblox on Mac - MacOS
- How to Split a String using Rust Language - Rust
- Java Generics: Type parameter cannot be instantiated directly - Java
- Eclipse : Workspace was written with an older version of the product and will be updated - Eclipse
- Java 8 Predicate Functional Interface with Examples (Lambda) - Java
- SharePoint Server 2016 IT Preview - new improved Features and Enhancements - SharePoint
- How to Move Columns in Microsoft Excel on Mac - MacOS