Courseiva
Essential ToolsmediumMultiple ChoiceObjective-mapped

EX200 Essential Tools Practice Question

An administrator receives an alert that a process named 'apache2' is consuming excessive CPU. The administrator needs to identify the PID of the process and then change its priority to the lowest possible value (least favorable scheduling). Which sequence of commands should be used?

⚠ Common exam trap

Red Hat often tests the exact range of nice values (0-19 for non-root users, -20 to 19 for root) and the distinction between `nice` (for starting processes) and `renice` (for changing priority of running processes), leading candidates to confuse the two or use out-of-range values.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

pidof apache2; renice -n 19 -p <PID>

`pidof apache2` retrieves the PID of the apache2 process, and `renice -n 19 -p <PID>` sets the priority to the lowest possible (least favorable) scheduling value. In Linux, `renice` accepts nice values from -20 (highest priority) to 19 (lowest priority), so 19 is the correct value for the least favorable scheduling.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • pidof apache2; renice -n 20 -p <PID>

    Why it's wrong here

    The pidof command correctly locates the PID(s) of apache2, but renice -n 20 is invalid because the Linux nice value range is -20 (highest priority) through 19 (lowest priority). A value of 20 falls outside this range, so the kernel rejects it with an 'invalid nice value' error. Even if the value were accepted, a positive nice value increases niceness and should stay at or below 19.

  • pidof apache2; renice -n 19 -p <PID>

    Why this is correct

    The pidof apache2 command directly outputs the PID(s) of the apache2 process, which can be passed to renice using -p. The renice -n 19 -p <PID> command sets the niceness of the existing process to 19, the lowest possible priority (often called 'most nice'). This is the correct way to reduce a running process's CPU priority on Linux; note that lowering priority (raising nice value) can be done by the process owner without root.

  • ps -C apache2 -o pid=; renice -n -20 -p <PID>

    Why it's wrong here

    The ps -C apache2 -o pid= command does produce a clean PID list, but renice -n -20 -p <PID> sets the niceness to -20, which is the highest possible priority—exactly the opposite of what the administrator wants. On Linux, negative nice values lower the numeric niceness and give the process more CPU priority, not less. Additionally, assigning a negative niceness generally requires root privileges, so this command would likely fail with 'Permission denied' if run by an unprivileged user.

  • ps aux | grep apache2; nice -n 19 <PID>

    Why it's wrong here

    The ps aux | grep apache2 pipeline may show apache2 processes, but using nice -n 19 <PID> is fundamentally wrong because the nice command is used only to start a new process with a specified niceness; it cannot modify the priority of an existing process. In fact, nice -n 19 <PID> treats the numeric PID as a command name, causing a 'No such file or directory' failure. For adjusting a running process, the correct tool is renice, not nice.

About these practice questions

One of 127 original EX200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.