File Descriptors

File descriptors are numbers from a table of all open files for a given program pointing in turn to all the open files running on the entire operating system.

Standard Reserved

The following standard file descriptors are reserved universally to represent the three main data streams:

0 Standard Input
1 Standard Output
2 Standard Error

Limited Number Of

The Linux kernel can only allocate so many file descriptors. On most systems you can check this by looking at this proc setting:

cat /proc/sys/fs/file-max

If you run out of file descriptors — by opening a lot of files and not closing them — you end up with a messed up system that will likely crash.