Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why rm dirname doesn't work ? It says it's a directory, well that I know :) but I want to delete it not even recursively as it is empty.

share|improve this question
The answer below is correct, but there's also no harm in doing rm -rf on an empty directory; it's identical to rmdir. Most of the time, if I don't care about what's in a directory, I'll use rm -rf rather than worry about whether or not it might be empty. – Jim Stewart Dec 20 '12 at 17:38

2 Answers 2

up vote 4 down vote accepted

Because you need to use rmdir?

share|improve this answer
that one works this time, thanks :) – asksuperuser Nov 1 '09 at 22:13
rm -d my_directory

from 'man rm':

-d Attempt to remove directories as well as other types of files.

share|improve this answer
I tried with -d it still says the same message – asksuperuser Nov 1 '09 at 22:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.