commands
rm — remove directory entries
Removes named entries rather than moving them to desktop Trash. Inspect each exact target first. Recursive removal is high risk and not needed here. A surviving hard link or open file may keep the object alive. Examples assume a fresh chapter files lab.
Formal Syntax & Structure
linux syntaxlinux
rm [OPTION]... FILE...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -i | option | Ask before each removal |
| -- | option | End option parsing |
| FILE | operand | Explicit disposable file to remove |
Return Value
filesystem change and exit status
GNU rm returns 0 on success and nonzero on failure. With -f, missing operands or nonexistent files need not produce an error; inspect intended entries rather than interpreting status as proof that data was erased.
Working Example
Example Snippetlinux
rm -- notes/-draft