Online Linux Terminal Logo
OnlineLinuxTerminal
DateioperationenCLI Manual

$rm

Remove files or directories from the filesystem.

BefehlssyntaxPOSIX Standard
rm [OPTIONS] FILE...
Linux-Community2.4k Online

Tausche dich mit Linux-Nutzern aus, lerne Befehle und lade PDF-Cheatsheets herunter.

Live im interaktiven Terminal ausprobieren

Client-seitige Simulation ohne Installation mit sofortigem Feedback.

Im Vollbild-Terminal öffnen ↗
bash — terminal

Überblick & Funktionsweise

`rm` (Remove) deletes files and directories. Linux filesystems do not have a "Recycle Bin" or "Trash" for CLI commands—once a file is removed with `rm`, its data blocks are unlinked immediately. Combining `-r` (recursive) and `-f` (force) allows removing non-empty directory trees.

Wichtige Optionen und Flags

Flag / OptionDescription
-r, -RRemove directories and their contents recursively.
-fForce removal without prompting for confirmation or reporting non-existent files.
-iPrompt interactively before every file removal.
-vVerbose mode explaining what is being deleted.

Praktische Anwendungsbeispiele

#1Remove a specific file
rm /home/user/notes.txt && ls -l

Deletes notes.txt and verifies the directory listing.

#2Recursively delete a directory and all files
rm -rf /tmp/test_dir

Forces recursive removal of the test directory without confirmation prompts.