Research Breakthrough Possible @S-Logix pro@slogix.in

Office Address

Social List

How to Create and Delete a Directory in HDFS?

Hadoop

Creating a Directory in HDFS

  • Description:
    Creating a directory in HDFS establishes a folder structure within the distributed file system, helping to organize and store files efficiently across the cluster.
Syntax
  • Command:
    $ hdfs dfs -mkdir data1

Deleting a Directory in HDFS

  • Description:
    Deleting a directory in HDFS removes the folder and all its contents (including files and subdirectories) from the distributed file system, freeing up resources.
Syntax
  • Command:
    $ hadoop fs -rm -r /path/to/directory
  • Example Command:
    $ hadoop fs -rm -r user/hduser/data1
  • hadoop fs -rm -r user/hduser/data1