June 2019
Intermediate to advanced
328 pages
7h 27m
English
When errors occur in commands, you’ll see both the standard output and standard error streams displayed on your screen. This makes it easier for you to see when something went wrong, but it makes it more difficult for you to send the output to a file or another program. To get around this, well-behaved programs separate diagnostics messages and other error messages to the standard error stream and leave it up to you to split them out. Like output, you’ll use a file descriptor to either send the errors to a file or suppress the messages.
Let’s look at an example of this in action. Use the find command to look at the contents of the /root folder, which you don’t have access to view:
| | $ find /root/ |
| | /root/ ... |