Question 210
During an introductory open-source workshop, the task is: A novice wants a long directory listing of a target folder without changing the active shell's current working directory. Which check should be added to the learning checklist?
Explanation
Correct Answer
Prefer explicit path operands in repeatable inspection commands. This practice reduces recurrence of the same problem. Technical reason: ls accepts a path operand and can list that directory from any current location. A controlled repeat test should show: The target folder entries appear while pwd continues to show the original working directory.
Incorrect Answers
The proposed action focuses on a control governed by: Use absolute paths for scripts that cannot depend on an interactive current directory. In this question the binding condition is: Prefer explicit path operands in repeatable inspection commands. Applying “Prefer explicit path operands in repeatable inspection commands” addresses that specific cause instead.
“Compare pwd with echo "$HOME" when teaching current versus home directory concepts” acts on a neighboring technical dependency: Compare pwd with echo "$HOME" when teaching current versus home directory concepts. It does not resolve the stated condition, whose causal mechanism is: Prefer explicit path operands in repeatable inspection commands. The required action is “Prefer explicit path operands in repeatable inspection commands”.
Run recursive listings on manageable paths to avoid excessively large output. That explains why “Run recursive listings on manageable paths to avoid excessively large output” is useful for its own dependency, but the present failure follows a different constraint: Prefer explicit path operands in repeatable inspection commands. The targeted correction is “Prefer explicit path operands in repeatable inspection commands”.