3.5. Input, Output, and Error ChannelsIn the example of the date command above, the output was written to the terminal window. Linux can write to files, but there are three default I/O channels that are always assumed active for every command or program.
By default, all three I/O channels are the terminal running the command or program. This enables commands to interact with the terminal easily and still use input from other places and write output to other places when necessary. The default I/O channels can be easily changed on the command line by using "redirection." We'll see examples of I/O redirection later in this chapter. For details on how the Linux I/O channels work see Chapter 12, "Systems Programming." |