Courseiva
Essential CommandshardMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

An administrator needs to find the process ID of the cron daemon. Which combination of commands is most effective?

⚠ Common exam trap

Watch out — candidates often choose `pgrep cron` (option B) because it seems simple, but they overlook that `pgrep` uses regex matching by default and may return multiple or incorrect PIDs, whereas `pidof` is designed for exact binary name matching.

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 cron

`pidof cron` directly returns the numeric process ID(s) of the cron daemon by searching the process name in the `/proc` filesystem. It is the most straightforward command for this specific task, as it outputs only the PID without additional formatting or filtering.

Answer analysis

Option-by-option breakdown

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

  • top -p $(pgrep cron)

    Why it's wrong here

    Interactive; not just retrieving the PID.

  • pgrep cron

    Why it's wrong here

    Also returns PIDs but can match similar names; not as precise as pidof.

  • pidof cron

    Why this is correct

    Returns the exact PID of the cron daemon.

  • ps -C cron -o pid=

    Why it's wrong here

    The `ps -C cron -o pid=` command is incorrect because `ps -C` filters processes by their *command name*. The `cron` daemon's executable is typically named `crond` (or similar, like `systemd-cron`), not simply `cron`. Consequently, this command would likely fail to identify the daemon's PID. It is tempting as `cron` is the service name, and this syntax would be effective if the daemon's actual command name were precisely `cron`, or for finding processes matching an exact executable name.

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.