How to List the Directory in HDFS

  • //To create a new directory
    Sample Code Segment

    FileSystem fs = FileSystem.get(conf);
    FileStatus[] status= fs.listStatus(new Path(“hadoop/path”));

    Command

    hadoop fs -ls <hadoop path>