← All commands
Topic hub File Management
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
Debian/Ubuntu same command
rm
Fedora same command
rm
Arch same command
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 optionUse
rm -rRemove directories recursively
rm -iAsk before deleting each file
rm -fForce delete (no prompts)
rm -vShow each file being deleted
rmdirRemove 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.

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

Related File Management commands