Before the technical explanation, a metaphor. Know when you send an email to a large company complaining about a product and get absolutely no response, this is the famous case where your email fell on /dev/null
, that is, someone saw it and left it there (or probably didn’t see it) and you didn’t have your answer.
The /dev/null
is a special file. You can redirect outputs to this device and the content will be intentionally discarded. The redirect to the /dev/null
always reports success in writing.
As stated by @Guilhermelautert in the comments, the /dev/null
is known as the Black Hole because of this.
In the context of the example of wget
, the /dev/null
is used as it is not necessary to download the content to a file, the goal is only to make a request for a certain URL. The content will obviously be transmitted from the server to the computer that ran wget, but as there is the -O
in command, the output will be redirected to the /dev/null
.
the black hole linux? everything that goes to it goes to :D
– Guilherme Lautert
What’s the problem with the question? What can be improved?
– Wallace Maxters
I saw no problems in the question. By the way, it’s a great question and what developers in general should know. After all, it is part of the WEB development to know what server wget is for and why /dev/null is used in this case.
– cantoni