Bird
0
0

Which wildcard pattern matches all files with any extension starting with log in their name?

easy📝 Conceptual Q11 of 15
Linux CLI - File and Directory Operations
Which wildcard pattern matches all files with any extension starting with log in their name?
A<code>log*</code> only matches files named exactly 'log'
B<code>log?</code>
C<code>log[0-9]</code>
D<code>log*</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand the wildcard *

    The * matches zero or more characters, so log* matches any file starting with 'log' followed by anything or nothing.
  2. Step 2: Compare other options

    log? matches 'log' plus exactly one character, log[0-9] matches 'log' plus one digit, and the last option is incorrect about log*.
  3. Final Answer:

    log* -> Option D
  4. Quick Check:

    Wildcard * matches any characters [OK]
Quick Trick: Use * to match any number of characters [OK]
Common Mistakes:
  • Confusing * with ? wildcard
  • Thinking * matches only one character
  • Misunderstanding [] as matching multiple characters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes