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.
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.
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.
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.
Have you tried :
hadoop dfs -rmr hdfs://host:port/Navi/MyDir\,\ Name
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With