Ask before deleting a file; -- ends option parsing.
rm -i -- old-draft.txtRemove files. This does not normally move them to a recoverable trash folder.
rm [OPTION]... FILE...Ask before deleting a file; -- ends option parsing.
rm -i -- old-draft.txtAsk once before removing multiple matching files.
rm -I -- *.tmp| Option / clause | Description |
|---|---|
-i, --interactive=always | Prompt before every removal. |
-I | Prompt once before removing many files or recursively. |
-f, --force | Ignore nonexistent files and never prompt. |
-r, -R, --recursive | Remove directories and their contents recursively. |
-d, --dir | Remove empty directories. |
-v, --verbose | Print each removed item. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.