Linux handles every object as a file. This includes input and output process.Linux identifies each file object using a file descriptor. File descriptor is a non negative number uniquely identifies open files in a session. Each process is allowed to have up to nine file descriptors at a time. shell program reserves first three( 0, 1, 2) for itself as input, output and error consecutievely.
* lsof command opens all the details of process and files with its desciptor. Below file desciptor is number with a permission like r- read, w- write, u- (read and write).