$rm
Remove files or directories from the filesystem.
rm [OPTIONS] FILE...Prueba en vivo en la terminal interactiva
Simulación del lado del cliente sin instalación y con respuesta inmediata.
Descripción general y funcionamiento
`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.
Opciones y banderas comunes
| Flag / Option | Description |
|---|---|
| -r, -R | Remove directories and their contents recursively. |
| -f | Force removal without prompting for confirmation or reporting non-existent files. |
| -i | Prompt interactively before every file removal. |
| -v | Verbose mode explaining what is being deleted. |
Ejemplos prácticos del mundo real
rm /home/user/notes.txt && ls -lDeletes notes.txt and verifies the directory listing.
rm -rf /tmp/test_dirForces recursive removal of the test directory without confirmation prompts.
Comandos de Linux relacionados
Busque archivos y directorios en una jerarquía según el nombre, tipo, tamaño o fecha de modificación.
Concatene e imprima el contenido de archivos en la salida estándar.
Create new directories and folder hierarchies.
Copy files and directories to a destination path.
Move or rename files and directories.
Create empty files or update file access and modification timestamps.