Display the per-process open-file-descriptor limit inherited by the current Bash and child processes.
Which command is appropriate?
Bash builtin ulimit -n displays the current open-file-descriptor limit.
Detailed explanation
ulimit -nCorrect. -n selects the open-file limit.
Correct. -n selects the open-file limit.
ulimit -uIncorrect. -u selects maximum user processes.
Incorrect. -u selects maximum user processes.
ulimit -vIncorrect. -v selects virtual memory.
Incorrect. -v selects virtual memory.
ulimit -cIncorrect. -c selects core-dump size.
Incorrect. -c selects core-dump size.
Try it yourself
An example you can run in a temporary verification environment.
bash -c 'ulimit -n'Expected result
現在のopen file descriptor上限を表す整数Key points
- -n is open files
- No value means display
- Inherited by child processes
Notes
- Environment: Bash 5.x / limit参照のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.