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

Updated:   |  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 Buy Me A Coffee



Comments


November 23 2023 by Darth Poster
Thank you

Add a Comment


Please enter cc241b in the box below so that we can be sure you are a human.