Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Not able to delete Directories with HDFS user id.

Not able to delete Directories with HDFS user id.

Contributor

When I tried hdfs dfs -rmdir /css/subfolder or hadoop fs -rmdir /css/subfolder or hadoop fs -rm -r /css/subfolder or hdfs dfs -rm -r /css/subfolder

I am getting rm: `/css/subfolder': No such file or directory or rmdir: `/css/subfolder': No such file or directory error.

I tried using hdfs user and individual user who created these subfolders. These subfolders were gets created when the user doesn't have home directory in hdfs.

How I can remove these subfolder either using hdfs user account or individual user account who created these?

5 REPLIES 5

Re: Not able to delete Directories with HDFS user id.

Super Guru
  • First find the user directory. generally it starts with /user/hdfs/...
  • It may be the directory is in /user/hdfs/css/subfolder
  • Using the user that owns the directory, delete it using fully qualified path /user/hdfs/css/*
Highlighted

Re: Not able to delete Directories with HDFS user id.

Contributor

there is no subfolder in /user/hdfs/css ...

Re: Not able to delete Directories with HDFS user id.

Super Guru

What user created it?

Use that

/user/userThatCreatedFile/css

Re: Not able to delete Directories with HDFS user id.

Contributor

Since user (/user/userThatCreated) was created in hdfs after creation of the subfolder by the user in /css. There is nothing in /user/userThatCreated

Re: Not able to delete Directories with HDFS user id.

Super Guru

Please run hadoop fs -ls /user/hdfs/ and provide the result.