Introduction to Input/Output Redirection
In order to extract information from different sources and format it for presentation, we’ll often need to use various utilities that are collectively known as text stream filters. When you work with text-stream filtering utilities, it only makes sense that you would need a way to feed them some sort of input. It also makes sense that you would need a way to see the output, and to see error messages if something goes wrong. For these purposes, we have stdin
, stdout
, and stderr
.
stdin
: This is short for standard input. By default,stdin
comes from the keyboard. However, by using pipes or redirectors, you can also obtainstdin
from either a file or from the output of another command.stdout
: This is short for standard output. By default,stdout
gets sent to your computer screen. You can use pipes to havestdout
become thestdin
for another command, or you can use redirectors to save thestdout
as a file on a storage device...