The current Bash has a nice value of 0.
Run nice sleep 60 without specifying an option.
What nice value will the started sleep normally have?
When no adjustment is supplied, nice starts the command with 10 added to the inherited nice value.
Detailed explanation
Incorrect. 0 is the unchanged parent value before nice applies its default adjustment.
Incorrect. 0 is the unchanged parent value before nice applies its default adjustment.
Correct. The inherited 0 plus nice's default adjustment 10 gives 10.
Correct. The inherited 0 plus nice's default adjustment 10 gives 10.
Incorrect. 19 is the lowest usual nice value, not the default adjustment result.
Incorrect. 19 is the lowest usual nice value, not the default adjustment result.
Incorrect. A negative value is the higher-priority direction and is not the default.
Incorrect. A negative value is the higher-priority direction and is not the default.
Try it yourself
An example you can run in a temporary verification environment.
nice bash -c 'ps -o ni= -p "$$"'Expected result
10(呼出し元のnice値が0の場合)Key points
- nice's default adjustment is 10
- The parent value is the starting point
- The adjustment moves toward lower priority
Notes
- Environment: GNU coreutils 9.x / 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.