Courseiva
Essential CommandsmediumMultiple ChoiceObjective-mapped

LFCS ps command Practice Question

A system administrator is troubleshooting a performance issue. They need to identify which process is consuming the most CPU time over the last 24 hours. Which command should be used?

⚠ Common exam trap

Candidates often choose `sar -u` because it provides historical data, but it only shows overall CPU utilization, not per-process information. The question asks for the process consuming the most CPU, which requires process-level data.

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

The most appropriate among the given choices because `ps aux --sort=-%cpu` lists all processes sorted by the current CPU usage percentage. While this shows a snapshot of current CPU consumption, the `%cpu` field represents the percentage of CPU time used since the process started, giving an approximation of the process's cumulative CPU usage. For historical data over the last 24 hours, process accounting (e.g., `sa` command) would be needed, but among the options, only A provides per-process CPU data.

Answer analysis

Option-by-option breakdown

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

  • ps aux --sort=-%cpu

    Why this is correct

    Correct. `ps aux --sort=-%cpu` displays processes sorted by CPU usage percentage, which reflects the process's CPU time over its lifetime, making it the best option for identifying the most CPU-consuming process.

  • sar -u -f /var/log/sa/sa$(date +%d)

    Why it's wrong here

    Incorrect. `sar -u` reports overall CPU utilization (user, system, idle, etc.) but does not provide per-process CPU time, so it cannot identify which specific process is consuming the most CPU.

  • top -b -n1

    Why it's wrong here

    Incorrect. `top -b -n1` shows a snapshot of processes, but it does not sort by CPU usage by default, and like `ps`, it only shows current values, not historical data.

  • uptime

    Why it's wrong here

    Incorrect. `uptime` shows system load averages, which are not per-process and do not indicate which process is using the most CPU.

About these practice questions

Courseiva writes every LFCS question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.