Question 230
A new Linux operator is assigned this task: A user wants to copy all files whose names end with .log but includes quotes around the wildcard and receives a literal filename error. Which concept explains this observed result?
Explanation
Correct Answer
Shell pathname expansion substitutes matching file names for an unquoted wildcard pattern. This explains the stated Linux behavior. The corresponding safe action is: Use a deliberate unquoted *.log glob after inspecting which files will match. Confirm it with: The command receives the two intended .log files and ignores an unrelated .txt file.
Incorrect Answers
The alternate statement is relevant when rmdir removes empty directories and refuses a nonempty directory rather than recursively deleting its files. Here the root condition follows: Shell pathname expansion substitutes matching file names for an unquoted wildcard pattern. It is not the same causal explanation.
The alternative mechanism is: touch can create a zero-byte file and changes modification/access times when applied to existing entries. The present evidence instead rests on: Shell pathname expansion substitutes matching file names for an unquoted wildcard pattern.
The offered principle concerns: mkdir -p creates missing intermediate path components and tolerates already existing directories. That is not what the current scenario establishes. Its controlling mechanism is: Shell pathname expansion substitutes matching file names for an unquoted wildcard pattern.