How to see top rows/records of file using hadoop fs command?


#1

In general, we can see 1KB of data from file using:
hadoop fs -tail

Like that, how to see data from top of the file instead of tail? I tried with -head but not working. Any idea?
Thanks
Venkat


#2

I tried with hadoop fs -head HDFS PATH. But this is not working.


#3

@avr8082 Use command like below.

hadoop fs -cat /public/retail_db/orders/part-00000 | head


#4

Hi BaLu,

Got it. It works. Thank you

Regards
Venkat


#5