0
votes

I accidentally created a directory in HDFS that is named 'again.' and I am trying to delete the directory. I have tried everything that I can think to help but, have been unsuccessful. I tried 'hdfs dfs -rm -r /user/[username]/*'. I tried 'hdfs dfs -rm -r '/user/[username]/again.'. None of these have worked ! Even the first which deleted every directory except for the directory that I wanted to delete.

Hadoop 2.7.3

Any thoughts ?

3

3 Answers

0
votes

You could try with a ? placeholder:

hdfs dfs -rm -r /user/[username]/again?

That could theoretically match other files too, but if you have only one matching file it should work tolerably well.

0
votes

Try using

hdfs dfs -rm -r "/user/[username]/again\."

or

hdfs dfs -rm -r ".\ /user/[username]/again\."

Note: In case you have Hue, please do it in Hue. That will make life easy.

0
votes

None of the responses worked but, thank you all for responding. I just dropped the entire directory structure and refreshed the environment from an existing instance.