How to delete a directory on Linux.

Posted: January 8, 2015. At: 4:05 PM. This was 3 years ago. Post ID: 8008
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

Deleting a directory on Linux is very easy indeed. The rmdir command will perform this task adequately. You could also use the rm -rf abc/ command to delete a directory, but rmdir is easier to remember.

eyjafjallajkull% rmdir abc

The rmdir command will not be able to delete a directory that is not empty, therefore you will need to use the rm -rf command to delete it in that case.

eyjafjallajkull% rm -rf abc

Just be careful when using this command as you could accidentally delete a required directory. But this command is very useful when you are managing your Linux file-system.

No comments have been made. Use this form to start the conversation :)

Leave a Reply