In most situations, output that is sent to stderr instead of stdout will contain words that make it clear you're dealing with an error. This will include examples such as permission denied, cannot execute binary file, syntax error near unexpected token, and so on.
Because of this, it is often not really necessary to split output into stdout and stderr (but, obviously, sometimes it will be great functionality). In these cases, the addition to Bash 4.x that allows us to redirect both stdout and stderr with a single command is perfect. This redirection, which you can use with the syntax &>, does not work differently to the earlier examples we have seen.
Let's review our previous example and see how this makes our lives easier:
reader@ubuntu:~/scripts/chapter_12$ ./stderr
This is sent to stdout.
This is sent to stderr.
reader@ubuntu:~/scripts/chapter_12$ ./stderr &> /tmp/output
reader@ubuntu:~/scripts/chapter_12$ cat /tmp/output
This is sent to stderr.
This is sent to stdout.
Excellent! With this syntax, we no longer have to worry about the different output streams. This is especially practical when working with commands that are new to you; in this case, you might miss interesting error messages because they got lost when the stderr stream is not saved.
At the risk of sounding repetitive, the syntax for appending both stdout and stderr to a file is again an extra >: &>>.
Go ahead and try it out with the previous example. We won't print it here, because it should be obvious by now how this works.