Courseiva
easyMultiple SelectObjective-mapped

XK0-006 Practice Question: Which TWO commands can be used to view a list of…

Which TWO commands can be used to view a list of all running processes with their PIDs? (Choose two.)

⚠ Common exam trap

Watch out — candidates often confuse `pidof` (which only finds PIDs for a named program) with a general process listing tool, or think `pstree` shows all processes when it actually defaults to the current user's process tree unless used with `-p` and `-a` options.

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

The `ps` command (option A) is correct because it displays a snapshot of current processes, and when used without options it shows processes for the current shell; with options like `-e` or `aux` it lists all running processes along with their PIDs. The `top` command (option C) is correct because it provides a real-time, dynamic view of all running processes, including their PIDs, and is commonly used for monitoring system activity.

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

    Why this is correct

    ps -ef displays all processes with PIDs.

  • pidof

    Why it's wrong here

    pidof returns PID for a named process, not all.

  • top

    Why this is correct

    top shows all running processes with PIDs interactively.

  • ls

    Why it's wrong here

    ls lists files, not processes.

  • pstree

    Why it's wrong here

    pstree shows tree but typically without PIDs by default (can be added).

About these practice questions

One of 979 original XK0-006 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 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.