Courseiva
Troubleshooting →mediumMultiple Select

XK0-006 Troubleshooting Practice Question

A Linux administrator is troubleshooting a server that is unresponsive. They suspect a process is consuming excessive CPU. Which TWO commands can be used to identify the process with the highest CPU usage? (Choose two.)

⚠ Common exam trap

Test-takers frequently confuse system-wide CPU monitoring tools like vmstat and iostat with per-process tools like top and ps; only the latter can identify a specific process.

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

✓

ps aux --sort=-%cpu | head -n 5

To identify a process consuming excessive CPU, the administrator needs tools that display per-process CPU usage. `top` provides a real-time, sorted list of processes by CPU usage. `ps aux --sort=-%cpu | head -n 5` gives a snapshot of the top CPU-consuming processes. Other commands like `free`, `vmstat`, and `iostat` show system-wide metrics but not per-process details.

Answer analysis

Option-by-option breakdown

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

  • ✗

    vmstat 1

    Why it's wrong here

    `vmstat 1` reports virtual memory statistics, CPU activity, and I/O in one-second intervals. While it shows overall CPU usage (user, system, idle), it does not list individual processes or identify which process is consuming CPU. It is useful for system-wide performance monitoring but not for pinpointing a specific process.

  • ✗

    free -m

    Why it's wrong here

    `free -m` displays memory usage in megabytes, including total, used, and free memory, as well as swap usage. It does not provide any information about CPU usage or individual processes. Therefore, it cannot help identify a process consuming excessive CPU. It is used for memory troubleshooting, not CPU.

  • ✗

    iostat -c

    Why it's wrong here

    `iostat -c` displays CPU utilization statistics, such as user, system, and idle percentages, but it does not show per-process CPU usage. It is primarily used for monitoring I/O and CPU load at a system level, not for identifying a specific process. Thus, it cannot directly identify the process with the highest CPU usage.

  • ✓

    ps aux --sort=-%cpu | head -n 5

    Why this is correct

    The `ps aux --sort=-%cpu` command lists all processes sorted by CPU usage in descending order, and piping to `head -n 5` shows the top five. This provides a snapshot of the processes with the highest CPU consumption. It is a non-interactive alternative to `top` and is useful for scripting or quick checks.

  • ✓

    top

    Why this is correct

    The `top` command provides a dynamic, real-time view of system processes, sorted by CPU usage by default. It displays the process ID, user, CPU percentage, and other details, making it easy to spot the process consuming the most CPU. It is an interactive tool that refreshes periodically, ideal for live troubleshooting of high CPU usage.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.