Dear Learner,

We hope you are doing well.

Please use the below given command to delete the directory from hdfs.

hdfs dfs -rmr /<filename>


Feel free to contact us in case you have any query.