Windows rd / rmdir equivalent in Linux
Deletes empty directories (rmdir) or directories with all their contents (rm -r).
rd / rmdir
rmdir / rm -r
rmdir / rm -r
rmdir / rm -r
Overview
What this command does
On Windows, "rd / rmdir" is used to remove directories. On Linux, the closest practical mapping shown here is "rmdir / rm -r". Deletes empty directories (rmdir) or directories with all their contents (rm -r). This reference is grouped under File Management → File System.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows rd / rmdir maps to rmdir / rm -r for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
Command-specific caution
rm -rf with a wrong path can delete critical files. Double-check the path — there is no undo.
For the broader concept behind this mapping, read Linux filesystem for Windows users.
Practical tasks
Common use cases
Remove directories
Deletes empty directories (rmdir) or directories with all their contents (rm -r).
rmdir dirname
Remove empty directory
rmdir -p a/b/c
Remove nested empty dirs
rm -r dirname
Remove directory and all contents
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
rmdir emptydir
rm -r MyFolder
rm -rv MyFolder
Walkthrough
Examples with explanations
# Windows: rd /s /q MyFolder
# Remove empty directory:
rmdir emptydir
# Remove directory and everything in it:
rm -r MyFolder
# Verbose — see what's being deleted:
rm -rv MyFolder
Reference
Common options and variations
| Command or option | Use |
|---|---|
rmdir dirname | Remove empty directory |
rmdir -p a/b/c | Remove nested empty dirs |
rm -r dirname | Remove directory and all contents |
rm -rf dirname | Force remove (no prompts) |
rm -rv dirname | Remove verbosely (see each file) |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "rmdir / rm -r" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | rmdir / rm -r |
Same command on this distribution. |
| Fedora | same command | rmdir / rm -r |
Same command on this distribution. |
| Arch | same command | rmdir / rm -r |
Same command on this distribution. |
Important
What to watch out for
Keep learning