- 0 - Input
- 1 - Output
- 2 - Error
Every file descriptor is associated with a value. The above list shows the 3 file descriptors and their associated value. Before we see too much into this, let us go straight to see some examples.
Output File Descriptor:
#cat f1 I am an Indian, And I love Unix. #
In the above example, the cat command displayed the contents of the file f1. The output of the cat command got displayed or got re-directed to the terminal which is the output file descriptor by default. To prove it, lets try this: