Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

ARCHIVED: In Unix, how do I remove a directory?

To remove a directory that you own, use the rmdir command. For example, to remove a subdirectory named mydir that exists in your current working directory, at the Unix prompt, enter: rmdir mydir If mydir exists, and is an empty directory, it will be removed. If the directory is not empty or you do not have permission to delete it, you will see an error message.

To remove a directory that is not empty, use the rm command with the  -r  option for recursive deletion. Be very careful with this command, because using the rm -r command will delete not only everything in the named directory, but also everything in its subdirectories. If you don't use this command very cautiously, you risk deleting all or most of your files.

If the subdirectory mydir exists in your current directory and it is not empty, you can delete it by entering at the Unix prompt: rm -r mydir

For more information on the rmdir and the rm -r commands, see their man pages. At the Unix prompt, enter: man rmdir

This is document abet in domain all.
Last modified on November 01, 2008.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.