Bird
0
0

You want to search for the word 'error' inside a large log file app.log while viewing it with less. Which command allows you to do this efficiently?

hard📝 Application Q8 of 15
Linux CLI - Viewing and Editing Files
You want to search for the word 'error' inside a large log file app.log while viewing it with less. Which command allows you to do this efficiently?
Amore app.log | grep error
Bgrep error app.log | less
Ccat app.log | less error
Dless app.log and then type /error
Step-by-Step Solution
Solution:
  1. Step 1: Understand searching inside less

    less supports interactive search by typing '/' followed by the search term.
  2. Step 2: Analyze other options

    more piped to grep filters output but does not allow interactive search; cat with less error is invalid syntax; grep piped to less shows only matching lines, not full file.
  3. Final Answer:

    less app.log and then type /error -> Option D
  4. Quick Check:

    Use / inside less to search [OK]
Quick Trick: Type /word inside less to search [OK]
Common Mistakes:
  • Using grep before less losing context
  • Trying invalid command syntax
  • Expecting more to support search
  • Not knowing less interactive features

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes