Linux for Developers
/Beginner
rm
Definition
Remove. The command used to permanently delete files or directories.
Explain Like I'm New
The delete button, but with no recycle bin. Once a file is gone, it is gone forever.
Real World Example
You want to delete an old log file. You type `rm old.log`. The file is permanently destroyed.
Common Use Cases
- •Cleaning up disk space
- •Deleting unwanted code
Crucial Command Flags
| Flag / Option | Description |
|---|---|
| -r / -R | Recursive. Remove directories and their contents. |
| -f | Force. Ignore nonexistent files, never prompt. |
| -i | Interactive. Prompt before every removal. |
Interview Questions
basic
- If you `rm` a file, can you easily recover it from the Trash/Recycle Bin?
intermediate
- What does the infamous command `rm -rf /` do?