Windows
Linux
File Management
File System
Windows del / erase equivalent in Linux
Removes files or directories. Be very careful — Linux has no Recycle Bin by default.
Windows
→
del / erase
Linux equivalents
rm
rm
rm
Overview
What this command does
Removes files or directories. Be very careful — Linux has no Recycle Bin by default.
Migration tip: There is no Recycle Bin in the Linux terminal. Deleted files are gone immediately. Always double-check your command, especially when using wildcards.
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
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| 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
NEVER run 'rm -rf /' — it deletes your entire system with no undo. Always review commands with wildcards or -rf before pressing Enter.
Keep learning