LFCS · Question #811
When starting a program with the nice command without any additional parameters, which nice level is set for the resulting process?
The correct answer is C. 10. This question evaluates understanding of the default nice level applied when the nice command is invoked without any specific adjustment.
Question
Options
- A-10
- B0
- C10
- D20
How the community answered
(18 responses)- A6% (1)
- C94% (17)
Why each option
This question evaluates understanding of the default nice level applied when the `nice` command is invoked without any specific adjustment.
A nice level of -10 provides a higher scheduling priority and would require explicit specification (`nice -n -10`) and often root privileges, not the default `nice` behavior.
A nice level of 0 is the default for processes started without the `nice` command, not when `nice` is used without arguments.
By default, if the `nice` command is invoked without any numeric argument or the `-n` option, it increases the nice value of the executed command by 10 relative to the parent process's nice value (which is typically 0). Therefore, the program will run with a nice level of 10.
A nice level of 20 is the lowest possible priority (highest nice value) and would typically be set using `nice -n 20` or `--adjustment=20`.
Concept tested: Default `nice` command nice level
Source: https://man7.org/linux/man/man1/nice.1.html
Topics
Community Discussion
No community discussion yet for this question.