0 votes
1 view
in Big Data Hadoop & Spark by (11.5k points)

I have uploaded a Directory to hadoop cluster that is having "," in its name like "MyDir, Name" when I am trying to delete this Directory by using rmr hadoop shell command as following

hadoop dfs -rmr hdfs://host:port/Navi/MyDir, Name

I'm getting the following messages rmr: cannot remove hdfs://host:port/Navi/MyDir,: No such file or directory. rmr: cannot remove Name: No such file or directory.

However I have successfully deleted other Directories from the same location, using the same command i.e.

hadoop dfs -rmr hdfs://host:port/dir_path

any solutions to delete such kind of Directories.

1 Answer

0 votes
by (31.4k points)
edited by

In your question the problem is not with the comma, the problem arises because of the space after the comma. Just place your arguments inside the quotes as given below:

hadoop fs -rm -r hdfs://host:port/Navi/MyDir\,\ Name

I hope your directory will be removed successfully.

If you want more information regarding the same, refer to the following video tutorial:

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !