Search code examples
linuxbashshelllimit

Limit for files opening


I am using the linux ulimit command to set some limits for opening files. If I am using ulimit -n 4 this will open just 1 file. If I am using ulimit -n 5 this will open 2 files. So the formula will be ulimit -n number of files+3. The question is why is that difference of +3? What is that 3 reprezent? Maybe one for file one for executable file and one for...?


Solution

  • Each process has the first three open file descriptors: stdin, stdout, stderr