utility
rm — external utility
Removes directory entries. It does not securely erase underlying data and is not a trash operation. -f ignores nonexistent operands; -i requests confirmation. Use explicit known paths and -- before operands. This fixture removes only one freshly created synthetic file; never run destructive recursive operations in shared directories. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): fixture removed.
Formal Syntax & Structure
bash syntaxbash
rm [-fi] [--] FILE...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| FILE | path | Explicit file to remove. |
Return Value
exit status
Zero on successful operation; nonzero on errors.
Working Example
Example Snippetbash
mkdir sampleprintf 'fixture\n' > sample/owned.txtrm -- sample/owned.txt || exit 1[[ ! -e sample/owned.txt ]] || exit 1printf 'fixture removed\n'