How to delete a directory on Linux.

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