•Arnošt Havelka
The RD Command
Remove empty directories.
Start Interactive LessonTo remove a folder, you use rd (or rmdir). By default, it acts as a safety mechanism: it only removes empty directories. If you want to delete a folder with contents, you need the /s switch.
Try the command
Try removing a directory!
Build the command
rd
directoryThe folder to remove.
Terminal
C:\Users\Student>rd EmptyDir
Real-World Examples
Remove an empty directory:
Terminal
C:\Users\Student>rd OldDocs
Remove a directory tree (Folder + Contents):
Terminal
C:\Users\Student>rd /s TempBuild
Knowledge Check
1 / 2What happens if you try to 'rd' a folder that contains files?
References
These documentation links provide authoritative details for the commands used in this article.
Up Next
Revision 2: Navigation & File Reading
Combine mkdir, cd, and type to set up and navigate workspaces efficiently.