Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to create and delete the directory in HDFS?

  • //To create a new directory
    Sample Code Segment

    Path path= new Path("user/D/filelLocation/");fs.mkdirs(path);


    hadoop fs -mkdir <path>

  • //To delete the directory
    Sample Code Segment

    FileSystem fs = FileSystem.get(conf);fs.delete(new Path(“path”,true)) //delete file


    hadoop fs -rm -r <hadoop path>