Courseiva
Essential Commands →easyMultiple Choice

LFCS Essential Commands Practice Question

A system administrator needs to identify the absolute path of the executable that would be run when typing the command 'ls'. Which command should they use?

⚠ Common exam trap

The trap here is assuming that any file-finding command can determine which executable runs, when only which considers the PATH and execution order.

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

✓

which ls

The which command is designed to search the PATH and report the full path of the executable that would be run. whereis, locate, and find do not respect the PATH or executable resolution order, so they cannot reliably answer which binary would execute. Thus, which is the correct choice.

Answer analysis

Option-by-option breakdown

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

  • ✗

    find / -name ls

    Why it's wrong here

    find searches the filesystem for files named 'ls' and will return many results, including directories and files not in the PATH. It is slow and does not indicate which one would be executed when typing 'ls'. This is not the appropriate tool for this task.

  • ✗

    whereis ls

    Why it's wrong here

    whereis locates the binary, source, and manual page files for a command. It does not strictly follow the PATH and may return multiple paths, including those not in the current PATH. It is not the precise tool for determining which executable would run.

  • ✓

    which ls

    Why this is correct

    The which command searches the directories listed in the PATH environment variable and displays the full path of the executable that would be executed. It is the standard tool for locating a command's binary in the user's path.

  • ✗

    locate ls

    Why it's wrong here

    locate uses a prebuilt database to find files by name and returns all matching paths, including directories and non-executables. It does not consider the PATH or executable permissions, so it cannot identify the specific binary that would be executed.

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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint

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.