Windows del / erase equivalent in Linux
Removes files or directories. Be very careful — Linux has no Recycle Bin by default.
del / erase
rm
rm
rm
Overview
What this command does
On Windows, "del / erase" is used to delete files and folders. On Linux, the closest practical mapping shown here is "rm". Removes files or directories. Be very careful — Linux has no Recycle Bin by default. 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 del / erase maps to rm 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
NEVER run 'rm -rf /' — it deletes your entire system with no undo. Always review commands with wildcards or -rf before pressing Enter.
For the broader concept behind this mapping, read Linux filesystem for Windows users.
Practical tasks
Common use cases
Delete files and folders
Removes files or directories. Be very careful — Linux has no Recycle Bin by default.
rm -r
Remove directories recursively
rm -i
Ask before deleting each file
rm -f
Force delete (no prompts)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
rm file.txt
rm -i *.tmp
rm -r MyFolder
rm -rf MyFolder
Walkthrough
Examples with explanations
# Windows: del file.txt
rm file.txt # delete a file
rm -i *.tmp # delete with confirmation prompt
# Windows: rmdir /s /q MyFolder
rm -r MyFolder # delete folder and all contents
rm -rf MyFolder # force delete (no prompts)
Reference
Common options and variations
| Command or option | Use |
|---|---|
rm -r | Remove directories recursively |
rm -i | Ask before deleting each file |
rm -f | Force delete (no prompts) |
rm -v | Show each file being deleted |
rmdir | Remove an empty directory only |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "rm" 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 | rm |
Same command on this distribution. |
| Fedora | same command | rm |
Same command on this distribution. |
| Arch | same command | rm |
Same command on this distribution. |
Important
What to watch out for
Keep learning