Let us see how we can preview the data in HDFS.
- If we are dealing with files contain text data (files of text file format), we can preview contents of the files using different commands as -tail, -cat etc.
- -tail can be used to preview last 1 KB of the file
- -cat can be used to print the whole contents of the file on the screen. Be careful while using -cat as it will take a while for even medium sized files.
- If you want to get first few lines from file you can redirect output of hadoop fs -cat to Linux more command