Online Linux Terminal Logo
OnlineLinuxTerminal
Opérations sur les fichiersCLI Manual

$rm

Remove files or directories from the filesystem.

Syntaxe de la commandePOSIX Standard
rm [OPTIONS] FILE...
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

`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.

Options et drapeaux courants

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.

Exemples pratiques du monde réel

#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.