File Operations
rm
Removes files or directories irreversibly. **WARNING:** Deleted files can usually not be recovered!
Ubuntu
CentOS
Debian
Arch
SUSE
Slackware
Fedora
Verified: 2025-09-09
Syntax
$rm [OPTIONS] FILE...
Optionen
-r, --recursive
Delete directories recursively
-f, --force
No prompts, ignore non-existent files
-i, --interactive
Ask before each deletion
-v, --verbose
Show deleted files
--preserve-root
Prevents accidental deletion of / (default in newer versions)
--one-file-system
Stays in the same filesystem
Examples
$rm file.txt
$rm -r folder/
$rm -rf /tmp/*
$rm -i important_file.txt
$rm --preserve-root /
Typical use cases
?
Standard usage
rm --help
Note
One of the most dangerous commands in the Linux arsenal. Always double-check! Alternatives: <code>trash-cli</code> for recoverable deletions, <code>shred</code> for secure deletion of sensitive data.
Export