Courseiva
Service Configuration →easyMultiple Choice

LFCS Service Configuration Practice Question

Which command displays the current status of all active services?

⚠ Common exam trap

Many exam-takers confuse `systemctl status --all` (which shows all units regardless of state) with listing only active services, or they mistakenly think `systemctl list-unit-files` shows current runtime status instead of disk-based enablement configuration.

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

✓

systemctl list-units --type=service --state=active

`systemctl list-units --type=service --state=active` filters systemd units to show only those of type 'service' that are currently in the 'active' state (i.e., running or exited but still considered active). This is the precise command to list all active services without showing inactive or failed units.

Answer analysis

Option-by-option breakdown

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

  • ✓

    systemctl list-units --type=service --state=active

    Why this is correct

    `systemctl list-units --type=service --state=active` queries systemd's unit manager directly, filtering loaded units by the service type and the active runtime state. This satisfies the stem's requirement to display every currently running service, unlike `systemctl status` (single unit) or `--state=running` (excludes active-but-exited ones).

  • ✗

    systemctl status --all

    Why it's wrong here

    systemctl status --all shows every loaded unit including inactive ones, so it does not isolate active services as the stem requires. It is tempting because status gives detailed per-unit state, and would be correct when inspecting one specific service.

  • ✗

    systemctl show --type=service

    Why it's wrong here

    systemctl show prints raw unit properties rather than a formatted status summary, and without --all it omits inactive units, so active services are not clearly listed. It is tempting for inspecting individual unit attributes, which is its actual purpose.

  • ✗

    systemctl list-unit-files --type=service

    Why it's wrong here

    list-unit-files enumerates installed unit files and their enablement state, not runtime activity, so active services cannot be identified. It is tempting for checking which services are enabled at boot, the scenario where it is the correct choice.

About these practice questions

This LFCS question is part of Courseiva's 406-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 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.