How to Remove a Directory?

Use `rmdir directory_name` to remove an empty directory

Use `rm -r directory_name` to remove a directory and its contents

Use `rm -rf directory_name` to force remove a directory and its contents

Use `del /s /q directory_name` in Windows Command Prompt for files inside a directory

Use `rmdir /s /q directory_name` in Windows Command Prompt to remove a directory and its contents

Use `Remove-Item -Recurse -Force directory_name` in PowerShell

Verify the directory path before deleting

Back up important data before removal

Suggested for You

Trending Today