How to view files on Hadoop

You can use the following command to view files on Hadoop:

  1. list the contents of the HDFS directory
hdfs dfs -ls /
  1. List the contents of the specified path in HDFS.
  2. The user named hadoop
hdfs dfs -ls /user/hadoop
  1. Display the contents of a file using hdfs dfs command.
  2. the file input.txt located in the Hadoop user directory
hdfs dfs -cat /user/hadoop/input.txt
  1. http://:50070

Please make sure that Hadoop is properly configured and the Hadoop cluster is up and running before using these commands.

bannerAds