Question 120
Before approving this basic Linux procedure, the team observes: A student writes a command using *.txt and expects the shell to pass a literal asterisk to the program, but several matching text files are selected instead. Which Linux system or command behavior most directly explains this result?
Explanation
Correct Answer
The technical basis is: For normal unquoted filename patterns, Bash pathname expansion substitutes matching directory entries before the command receives its arguments. Resolve this through: Quote a literal wildcard when text is intended, or use a scoped glob only when matching all eligible filenames is deliberate. The expected evidence is: A controlled directory test demonstrates the difference between an expanded *.txt list and a quoted literal pattern.
Incorrect Answers
The rmdir utility is intended for empty directories and refuses to remove a directory that still contains entries. “List the target directory, handle its contents through a separately approved process, then use rmdir when it is empty” would remedy that alternative situation, but it would not correct the present issue: for normal unquoted filename patterns, Bash pathname expansion substitutes matching directory entries before the command receives its arguments.
“Run the utility's supported help flag for basic syntax and consult its manual for deeper option semantics” is the supported response when short command help commonly summarizes syntax, whereas man pages or extended documentation provide additional concepts and examples. Here the decisive response is “Quote a literal wildcard when text is intended, or use a scoped glob only when matching all eligible filenames is deliberate”, so that different intervention does not meet the stated requirement.
The ls long format displays file type, permission bits, ownership, sizes and other metadata not shown in a simple filename list. “Run ls -l against the intended path and read the file type and permission character groups correctly” applies to that other condition. The reported evidence is a student writes a command using *.txt and expects the shell to pass a literal asterisk to the program, but several matching text files are selected instead; this alternative would address the wrong dependency.