← All commands
Topic hub File Management
Windows Linux File Management Expanded guide File System

Windows rd / rmdir equivalent in Linux

Deletes empty directories (rmdir) or directories with all their contents (rm -r).

Windows rd / rmdir
→
Linux equivalents
Debian/Ubuntu same command
rmdir / rm -r
Fedora same command
rmdir / rm -r
Arch same command
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.

Migration tip: <code>rmdir</code> only removes <strong>empty</strong> directories. To remove a directory and everything inside it use <code>rm -r</code>. Add <code>-v</code> to see each file being deleted.

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.

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 optionUse
rmdir dirnameRemove empty directory
rmdir -p a/b/cRemove nested empty dirs
rm -r dirnameRemove directory and all contents
rm -rf dirnameForce remove (no prompts)
rm -rv dirnameRemove 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.

DistributionPackage manager / baseEquivalent commandDifference 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

rm -rf with a wrong path can delete critical files. Double-check the path — there is no undo.

Keep learning

Related File Management commands