Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to learn some directory navigagtion with bash and all I know is that

rmdir directoryname

will remove the directory but not if it's containing something. Is there a way to force it to remove the subdirectories, even if they're not empty?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The following command will do it for you. Use caution though.

rm -rf directoryname
share|improve this answer
5  
"-f" is "--force" which overrides some sanity checks and prompting. A safer command to start with would be rm -r directoryname. –  Jim Paris Aug 17 '12 at 3:35
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.