Courseiva
Essential CommandsmediumMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

A system administrator is troubleshooting a user's report that a command 'myapp' is not found. The administrator checks the PATH variable and sees it includes /usr/local/bin. The administrator verifies that the binary 'myapp' exists in /usr/local/bin with permissions 755. However, running 'myapp' still fails with 'command not found'. What is the most likely cause?

⚠ Common exam trap

Linux Foundation often tests the concept that the shell's hash table can cause 'command not found' errors even when the binary exists and permissions are correct, leading candidates to incorrectly focus on PATH or permissions.

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

The shell's hash table is stale; run 'hash -r'

The shell caches the locations of executables in a hash table to avoid searching PATH repeatedly. When a new binary is added to a directory already in PATH, the shell may still have a stale entry (or no entry) for that command, causing it to report 'command not found' even though the binary exists. Running 'hash -r' clears the entire hash table, forcing the shell to re-scan PATH on the next invocation.

Answer analysis

Option-by-option breakdown

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

  • The user's PATH does not include /usr/local/bin

    Why it's wrong here

    The administrator checked the PATH and it includes the directory, but this is the administrator's PATH, not the user's. However, the question implies the administrator is testing as the user or the user's environment is similar.

  • The binary is a shell script missing a shebang

    Why it's wrong here

    If it's a binary, no shebang needed. If it's a script, missing shebang would cause different error.

  • The shell's hash table is stale; run 'hash -r'

    Why this is correct

    Correct: the shell caches command locations, and may not have updated after the binary was added.

  • The binary does not have execute permission for the user

    Why it's wrong here

    Permissions are 755, so execute is allowed.

About these practice questions

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