Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Delete a directory from Hadoop cluster which is having comma(,) in its name?

Tags:

file

hadoop

comma

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.

like image 327
java_dev Avatar asked Nov 23 '12 12:11

java_dev


People also ask

How do I delete a folder that is not empty?

To remove a directory that is not empty, use the rm command with the -r option for recursive deletion. Be very careful with this command, because using the rm -r command will delete not only everything in the named directory, but also everything in its subdirectories.

How do I delete a folder in cloudera?

hdfs rm -r will delete the path you have provided recursively. The specified location will be deleted from hdfs cluster. So, that means it is deleted from entire hdfs cluster. If trash option is enabled, it will move the deleted files to trash directory.

What command is used to remove directory from Hadoop recursively?

You will find rm command in your Hadoop fs command. This command is similar to the Linux rm command, and it is used for removing a file from the HDFS file system. The command –rmr can be used to delete files recursively.


1 Answers

Have you tried :

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

like image 186
gega Avatar answered Sep 24 '22 06:09

gega