Well, with the date command the result is streamed to the output, which is by default is connected to terminal screen.
Hence, Amazing thing about output data streams is that you can redirect where they go using a process, imaginative, imaginatively called redirection. So just like redirecting a pipe will change where water flows, redirecting a data stream will change where the data goes.
So now when a command gives an error message or a log message or something, anything that isn’t the primary output of the command that is outputted into the stream known as standard error.This helps keep useful output and log or error information separate.
So, for example, let’s take the date command again.If I make the date command fail by giving it some invalid command argument like this ‘ sgdfdlfjdljffd’
, and then I press enter, you’ll see that we get an error message and it says invalid date ‘ sgdfdlfjdljffd’
OK, now, because it’s an error message, it was sent down the standard error stream and because the error message arrived at our terminal screen, we can see that the standard error is also automatically connected to our terminal, just like standard output.Hence the error message is output is terminal also.