Curl - Suppress output using the -o or --output /dev/null option

by
Jeremy Canfield |
Updated: June 24 2022
| Curl articles
Let's say the following curl command display the content of the index.html page on the www.example.com web server.
~]# curl http://www.example.com/index.html
<html>
<body>
Hello World
</body>
</html>
The curl command with the -o /dev/null option can be used to suppress the response body output. Something like this should be displayed.
~]# curl -o /dev/null http://www.example.com/index.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 24 0 24 0 0 380 0 --:--:-- --:--:-- --:--:-- 727
If you also want to supress the progress bar, the -s or --silent flag can be used.
~]# curl --silent -o /dev/null http://www.example.com/index.html
Now the curl command returns no output. This is typically used when you want to:
Did you find this article helpful?
If so, consider buying me a coffee over at
Comments
November 23 2023 by Darth Poster
Thank you