LPIC-1 Shells, Scripting and Data Management Practice Question
Exhibit
The output of 'set | grep -i path' returns: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Refer to the exhibit. An administrator installed a new command in /opt/bin/ but cannot run it without specifying the full path. What is the likely cause?
⚠ Common exam trap
Candidates often confuse a missing PATH entry with a permission issue, but the key clue is that the command runs when the full path is specified, which rules out permission problems and points directly to the PATH variable.
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 command is not in the PATH.
The administrator installed the command in /opt/bin/, but the shell cannot find it without the full path because /opt/bin/ is not listed in the PATH environment variable. The PATH variable defines the directories the shell searches for executable commands; if a directory is omitted, commands within it must be invoked with an absolute or relative path.
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 command is not in the PATH.
Why this is correct
The shell searches only directories listed in PATH when resolving bare command names. Since /opt/bin is absent from PATH, the binary is unfindable without its full path. Adding that directory to PATH restores normal lookup.
- ✗
The command is an alias that conflicts.
Why it's wrong here
Aliases are defined in shell configuration files and expand to existing commands; they are not files installed into /opt/bin/. The symptom arises because /opt/bin/ is missing from PATH, so the shell cannot locate the executable by name. Aliases matter when shortening frequently typed commands interactively.
- ✗
The command has no execute permission.
Why it's wrong here
A missing execute bit yields 'Permission denied', not a command-not-found failure requiring the full path. The actual cause is that /opt/bin is absent from the user's PATH, so the shell cannot locate the binary. Execute permission would be the issue if invocation failed with an access error.
- ✗
The command is a function that overrides.
Why it's wrong here
Shell functions live in the current shell's memory, not in /opt/bin/, and would be invoked by name without a path anyway. The failure stems from /opt/bin/ being absent from the PATH variable, so the shell searches only listed directories. Functions are relevant when overriding an existing command's behaviour within a session.
Go deeper
Related to this question
About these practice questions
One of 402 original LPIC-1 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.