Section 6:51. Running HDFS Commands Using Hive

The steps to follow the Hdfs commands using Hive

  1. Open the Hive CLI by typing “hive” in your terminal.
  2. Once you are in the Hive CLI, you can use the “dfs” command to execute any Hadoop command. For example, if you want to list the contents of a directory in HDFS, you can use the following command:
  3. dfs  is alias for hadoop fs
  4. If you want list the files using this command   dfs -ls /path/to/directory; 

   5.if you want list the files in recursive fashion   dfs -ls -r /path/to/directory; 

Share this post