LX0-103 · Question #211
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. When nice is invoked without a -n argument, it applies a default niceness adjustment of +10 to the launched process.
Question
When starting a program with the nice command without any additional parameters, which nice level is set for the resulting process?
Options
- A-10
- B0
- C10
- D20
How the community answered
(37 responses)- A3% (1)
- C92% (34)
- D5% (2)
Why each option
When nice is invoked without a -n argument, it applies a default niceness adjustment of +10 to the launched process.
-10 raises a process above the default priority and requires root privileges; it must be explicitly specified with nice -n -10 and is never applied as a default.
0 is the niceness inherited by a process launched normally without nice - invoking nice applies an increment on top of the existing value, not zero.
The POSIX specification and GNU coreutils implementation both define the default adjustment for nice as +10 when no explicit value is supplied. Niceness ranges from -20 (highest CPU priority) to +19 (lowest), so +10 reduces the process's scheduling priority below the baseline of 0. This makes the process yield CPU time more readily without requiring any privilege escalation.
20 is not the default increment; it is sometimes confused with the upper end of the niceness scale, but the actual default adjustment defined in the standard is +10.
Concept tested: nice command default niceness increment value
Source: https://man7.org/linux/man-pages/man1/nice.1.html
Topics
Community Discussion
No community discussion yet for this question.