STDERR

STDERR is another output stream beyond STDOUT, and it's like that for a good reason. You want the two data streams separated. We already covered STDOUT; it is the first. The second, STDERR, stands for standard input error. STDERR is the output stream that error messages are sent to in Unix. This is commonly the end user's terminal.

If the user is redirecting STDOUT and the program can only put errors on STDOUT, the user might never see the errors that all go into the redirected file. Instead, programs can use STDERR for errors. If the user has not redirected it, then he can still see error messages and warnings while STDOUT is headed into another file or program.

If you want to put STDERR into the same file in which you're storing STDOUT, ...

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.