The current login shell has a nice value of 0.
Start an ordinary child process without nice or renice.
Which nice value does the child inherit?
Linux child processes inherit the parent's nice value. With a parent value of 0 and no explicit adjustment, the child starts at 0.
Detailed explanation
Correct. The child inherits the shell's nice value of 0.
Correct. The child inherits the shell's nice value of 0.
Incorrect. 10 is a common adjustment used by nice when no value is specified, not the unchanged inherited value.
Incorrect. 10 is a common adjustment used by nice when no value is specified, not the unchanged inherited value.
Incorrect. 19 is the lowest scheduling priority value, not the default.
Incorrect. 19 is the lowest scheduling priority value, not the default.
Incorrect. -20 is the highest-priority direction and is not the default.
Incorrect. -20 is the highest-priority direction and is not the default.
Try it yourself
An example you can run in a temporary verification environment.
bash -c 'ps -o ni= -p "$$"'Expected result
通常は0(呼出し元シェルのnice値を変更していない環境)Key points
- Children inherit the parent's nice value
- The ordinary default is 0
- nice changes the value explicitly
Notes
- Environment: Linux / procps-ng
- 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.