I am unable to delete a directory inside my pen drive. The directory is actually empty. When I right click on it and look for its properties, I can just see Contents: nothing
. But when I try to delete it from terminal, it says rm: cannot remove 'x': Directory not empty
. x is the name of the directory which I wanna delete. I have tried all the following. But nothing has helped me till now.
I got a window which read
Cannot delete directory
when i used shift + del. The window also had an error details option. When I clicked on it, it readDirectory not empty
As I said earlier, I got a message
rm: cannot remove 'x': Directory not empty
when I tried deleting it from terminal using therm -rf x
command. And I trying it from my pen drive. So, I hope the path x isn't any issue hereI gave it a shot with
rm -ir x
. Firstly it showedrm: descend into directory 'x'?
. I entered y and hit enter. It showedrm: remove directory 'x'?
. I confirmed again. It displayedInput/output error
I was wanting to get rid of it somehow. So, eventhough I knew that both
rm -r x
andrn - R x
are the same, I made a mad try withrm -R x
. It showed the samerm: cannot remove 'x': Directory not empty
I tried using
rmdir x
as I was sure that it had no contents inside it. Yet, it was a failure. It showedrmdir: failed to remove 'x': Directory not empty
Help me delete that strangely behaving directory. Thanks in advance.
ls -a x
may well show a hidden file, which therm -rf x
command should remove. Trysudo rm -rf x
?ls -a x
. Even it displayed nothing.