Remove files or directories permanently with no recycle bin.
high risk
ls -la <target>Preview what you are about to delete.rm -rI <dir>Ask once before a recursive delete (-I); use -i to be asked for every file.trash-put <path>Move to the trash (trash-cli) so it can be recovered.rm deletes files immediately. There is no recycle bin on Linux. The -rf combination recursively forces deletion — extremely dangerous near / or $HOME. Always double-check paths in scripts and never use unquoted variables.
| Flag | Meaning |
|---|---|
-r --recursive | Remove directories and all their contents |
-f --force | Ignore nonexistent files, never prompt |
-i --interactive | Prompt before every removal |
-v --verbose | Show each file as it is removed |
rm -i file.txtDelete file with confirmation prompt · explain & risk-check →rm -rf /tmp/build_artifacts/Force-delete a build directory recursively · explain & risk-check →find . -name '*.tmp' -deleteSafer: find and delete tmp files without rm -rf · explain & risk-check →Never run `rm -rf $VAR/path` — if $VAR is empty it becomes `rm -rf /path`. Always validate and quote variables before destructive commands.
Reference text is hand-written and may be incomplete — check man rm for your version. Test destructive commands on a non-production system first.