Shankar
Shankar

Reputation: 8957

HDFS command to find the specific record in a text file based on text / word

I have a text file in HDFS, i need to find a record(s) containing the specific text word.

For example:

1,Sam,22,Developer
1,Any,38,Manager
1,Mike,30,TechnicalLead
1,John,32,SM
1,Alice,34,Manager

I need to find the records with Manager text.

What is the command to get the records based on Manager Text.

Upvotes: 1

Views: 370

Answers (1)

RRR
RRR

Reputation: 11

You can use below command to find records which contains "Manager".

hadoop fs -cat hdfspath/filename | grep "Manager"

Upvotes: 1

Related Questions