Bird
0
0

In awk, what does a pattern do?

easy📝 Conceptual Q11 of 15
Linux CLI - Text Processing
In awk, what does a pattern do?
AIt selects which lines to process
BIt changes the file content permanently
CIt saves the output to a file
DIt runs a shell command
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of patterns in awk

    Patterns in awk are used to match lines in the input data. Only lines matching the pattern are processed.
  2. Step 2: Differentiate patterns from actions

    Actions define what to do with matched lines, but patterns decide which lines to select.
  3. Final Answer:

    It selects which lines to process -> Option A
  4. Quick Check:

    Pattern = line selector [OK]
Quick Trick: Patterns filter lines before actions run [OK]
Common Mistakes:
  • Thinking patterns change file content
  • Confusing patterns with output commands
  • Assuming patterns run shell commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes