GSEC practice question 31 of 35
John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working as a root user on the Linux…
Full set: 383 questionsDomain Linux: Security and Administration
The nice command is used to modify the scheduling priority of a process in Linux. The "niceness" value ranges from -20 (highest priority) to +19 (lowest priority). A lower niceness value means the process is less "nice" to others and demands more CPU time. To assign the highest possible priority to the cc command, its niceness value must be set to -20. Only the superuser (root) has the privilege to set a negative niceness value, which increases a process's priority relative to others. The command nice -n -20 explicitly sets this highest priority level.
A. nice -n 19 cc -c .c & This command sets the niceness value to +19, which is the lowest possible priority, not the highest.
B. nice cc -c .c & Running nice without a specified value defaults to increasing the niceness by 10, resulting in a lower priority.
D. nice cc -c .c This is functionally the same as option B regarding priority; it defaults to a lower priority (niceness +10). ---
1. Linux Programmer's Manual
nice(1): The official man page for the nice command states
"nice runs command with an adjusted niceness
which affects process scheduling. If an adjustment is given
it is added to the current niceness value. The range of niceness values is from -20 (most favorable to the process) to 19 (least favorable to the process)... Only the superuser may specify a negative adjustment."
Source: nice(1) — Linux manual page. Available via man nice on any standard Linux distribution.
2. Stallings
W. (2018). Operating Systems: Internals and Design Principles (9th ed.). Pearson. In the chapter on UNIX and Linux scheduling
the text explains: "The nice value is a number in the range -20 to +19
where -20 is the highest priority and +19 is the lowest priority... A nonprivileged user can only increase the nice value of a process... The superuser can both increase and decrease the nice value."
Reference: Chapter 9
Section 9.5 "Linux Scheduling".
3. University of Chicago
Department of Computer Science. (2015). CMSC 12100: Introduction to Linux. Course materials on process management explain the nice command: "The range of nice values is from -20 to 19. The lower the value
the higher the priority of the process... By default
processes start with a nice value of 0. Only the root user can set negative nice values."
Source: Available through University of Chicago's public course archives for CMSC 12100.
Keep practicing
Take the free GSEC practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GSEC practice questions
- Question 1What is the key difference between Electronic Codebook mode and other block cipher modes …
- Question 2Which of the following systems acts as a NAT device when utilizing VMware in NAT mode?
- Question 4You are doing some analysis of malware on a Unix computer in a closed test network. The I…
- Question 5You work as a Network Administrator for McNeil Inc. The company has a Linux-based network…
- Question 6Which of the following services resolves host name to IP Address?
- Question 7What does PowerShell remoting use to authenticate to another host in a domain environment?
