rm: Remove — Delete files or directories. rm deletes files. rm old.log removes one file, rm -r folder removes a folder and everything in it, and rm -f skips confirmations and errors for missing files. There is no recycle bin. Deleted files are gone, which is why rm -rf deserves respect. A space in the wrong place, or a variable that turns out to be empty, can delete far more than intended.
A few habits protect you. Run ls with the same path first to see what would be deleted. In scripts, check that variables are set before using them in a path, for example with ${DIR:?} in Bash, which stops the script when DIR is empty. Use rm -i when deleting interactively in unfamiliar folders. And keep backups, because sooner or later everyone deletes something they needed.
Use before running or suggesting shell commands with flags, especially destructive or broad ones (-f/--force, -r/-R recursive, -a/--all, -y/--yes, prune, --hard), and when a user asks what a flag means (-v, -q, -n/--dry-run, -h, -o, -p, -t, -u, -w, -x, -c, -i). Explains flags per tool and prefers dry runs and narrow scopes.
Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.
Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`,