How to delete a directory from Hadoop cluster which is having comma in its name

0 votes
I have created a directory in hadoop that is having "," in its name like "SampleDir, Name". But, when I am trying to delete this Directory by using rmr hadoop shell command as following

hadoop dfs -rmr hdfs://host:port/User/SampleDir, Name
I'm getting the following error

rmr: cannot remove hdfs://host:port/User/SampleDir: No such file or directory. rmr: cannot remove Name: No such file or directory.

But I didn't face any issues while deleting other directories from the same location, using the same command i.e.

hadoop dfs -rmr hdfs://host:port/dir_path
Can anyone tell me the way how to delete such kind of directories?

Thanks in advance!
May 7, 2018 in Big Data Hadoop by Shubham
• 13,480 points
922 views

1 answer to this question.

0 votes

Just try the following command:

hadoop fs -rm -r hdfs://host:port/User/SampleDir\,\ Name

I hope it will work.

answered May 7, 2018 by nitinrawat895
• 11,380 points

Related Questions In Big Data Hadoop

0 votes
11 answers
0 votes
1 answer

How to delete a file from Hadoop hdfs using java?

Try this: FileSystem fs = FileSystem.get(getConf()); fs.delete(new ...READ MORE

answered Nov 28, 2018 in Big Data Hadoop by Omkar
• 69,090 points
3,000 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
2,588 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
6,820 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
47,997 views
+1 vote
1 answer
0 votes
1 answer

How to access different directories in a Hadoop cluster?

You need to configure the client to ...READ MORE

answered Sep 18, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
201 views
0 votes
7 answers

How to run a jar file in hadoop?

I used this command to run my ...READ MORE

answered Dec 10, 2018 in Big Data Hadoop by Dasinto
13,756 views