Skip to main content
Linux AdministrationMediumSingle Choice

Linux Administration Question

Statement

Regarding the command:

nice -5 /usr/bin/prog

Which of the following statements is correct?

#nice#nice-value#process-priority#scheduling
A

/usr/bin/prog is executed with a nice level of -5.

B

/usr/bin/prog is executed with a nice level of 5.

Correct
C

/usr/bin/prog is executed with a priority of -5.

D

/usr/bin/prog is executed with a priority of 5.

Resolution & Explanations

The nice command in Linux is used to run a program with a modified scheduling priority. The nice value ranges from -20 (highest priority) to 19 (lowest priority). The command nice -5 /usr/bin/prog sets the nice value to 5, meaning the process runs with a lower priority than the default (which is 0). The syntax nice -n 5 or nice -5 both set the nice value to 5. Note that the argument after nice is the increment to the nice value; a positive number lowers priority, while a negative number raises priority (requires root privileges). Therefore, /usr/bin/prog is executed with a nice level of 5.