Bird
0
0

Given the command hdfs dfs -cat /logs/app1.log | grep ERROR, what is the expected output?

medium📝 Predict Output Q13 of 15
Hadoop - Cluster Administration
Given the command hdfs dfs -cat /logs/app1.log | grep ERROR, what is the expected output?
AA list of files in /logs directory
BAll lines from app1.log
COnly lines without the word 'ERROR'
DOnly lines containing the word 'ERROR' from app1.log
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command parts

    hdfs dfs -cat /logs/app1.log outputs the file content; grep ERROR filters lines with 'ERROR'.
  2. Step 2: Combine command effects

    The pipe sends file content to grep, which shows only lines containing 'ERROR'.
  3. Final Answer:

    Only lines containing the word 'ERROR' from app1.log -> Option D
  4. Quick Check:

    grep ERROR filters lines with ERROR [OK]
Quick Trick: Pipe file content to grep ERROR to find error lines [OK]
Common Mistakes:
  • Thinking grep removes ERROR lines
  • Expecting full file output
  • Confusing grep with listing files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes