LPIC-1 Exam 101 v5 (Linux Administrator) — Question 21
Which wildcards will match the following filenames? (Choose two.) ttyS0 ttyS1 ttyS2
Answer options
- A. ttyS[1-5]
- B. tty?[0-5]
- C. tty*2
- D. tty[A-Z][012]
- E. tty[Ss][02]
Correct answer: B, D
Explanation
Option B, tty?[0-5], correctly matches any filename starting with 'tty' followed by any single character and then a digit from 0 to 5, fitting ttyS0, ttyS1, and ttyS2. Option D, tty[A-Z][012], matches filenames starting with 'tty' followed by any uppercase letter and then either 0, 1, or 2, which also fits all the given filenames. The other options do not meet these criteria.