what is file descriptor in unix & stdin stdout stderr
File descriptor. In Unix and related computer operating systems, a file descriptor (FD, less frequently fildes) is an abstract indicator (handle) used to access a file or other input/output resource, such as a pipe or network socket. File descriptors form part of the POSIX application programming interface.
stdin is just another name for FD 0. stdout is just another name for FD 1. stderr is just another name for FD 2. By definition, anything going to FD 0 is going to stdin. By definition, anything coming from FD 1 is coming from stdout. By definition, anything coming from FD2 is coming from stderr.