101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 63


Regarding the command:

nice -5 /usr/bin/prog

Which of the following statements is correct?

Show Answer
Correct Answer: B

The nice command sets the priority level of a process. By default, the nice value is 0, and it ranges from -20 (highest priority) to 19 (lowest priority). When using the nice command, specifying a positive value (e.g., nice 5) increases the nice level, reducing the process's priority. However, when specifying a negative value directly with nice (e.g., nice -5), it will actually be interpreted as an argument requiring superuser privilege to decrease the nice level and increase the priority. Since typical conventions mean nice values are positive following nice command context, the correct interpretation without elevated permission context means /usr/bin/prog is executed with a nice level of 5.

Discussion

2 comments
Sign in to comment
ignasiOption: A
Oct 30, 2021

i think it shpuld be a as fa as i know nice default value is 0

aries_jamie
Mar 30, 2022

If there is no value is provided, nice sets to 10 as default. A command or program run without nice defaults to 0

DuboisNicolasDuclairOption: A
Oct 21, 2023

The correct statement regarding the command `nice -5 /usr/bin/prog` is: A. `/usr/bin/prog` is executed with a nice level of -5. In the `nice` command, when you specify a nice level with a negative value, it reduces the process's priority, making it less favorable for CPU time, and hence the process is executed with a lower nice level. In this case, a nice level of -5 is set for the `/usr/bin/prog` command.