Request URL With wget Without Saving File

Last updated on Jan 3, 2020 in Linux

You can easily download a URL from Linux command line by using ´wget´, and its default behavior is to save the file. However, you might want to disable the saving the file and just make the request.

Redirect wget Output to /dev/null

$ wget -O /dev/null

The -O stands for output and the next argument /dev/null is practically a Linux trash can where you can dump useless data.

This line makes the request and does not save the downloaded file. However, it still produces output (not printed above). In order to disable also the ouput, we can suppress everything as well.

Suppress wget Output Completely

$ wget -O /dev/null -q

Here we added -q to describe quiet mode. When you execute this, you will not receive any response, not even error messages.