Bird
0
0

Which awk pattern matches every line of input?

easy📝 Conceptual Q2 of 15
Linux CLI - Text Processing
Which awk pattern matches every line of input?
ABEGIN
BEND
C1
D$0 == ""
Step-by-Step Solution
Solution:
  1. Step 1: Recall special patterns in awk

    BEGIN and END are special patterns for start and end of input, not every line.
  2. Step 2: Understand numeric pattern '1'

    In awk, a pattern of '1' always evaluates true, so it matches every line.
  3. Final Answer:

    Numeric pattern '1' matches every line -> Option C
  4. Quick Check:

    Pattern '1' = match all lines [OK]
Quick Trick: Pattern '1' always matches all lines [OK]
Common Mistakes:
  • Choosing BEGIN or END as line matchers
  • Misunderstanding $0 == "" matches empty lines only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes