Learn how `rm` removes files, which options prevent disaster, and how to combine it safely with other tools. 26.04.2026 | reading time: 2 min The `rm` command removes files and directories from the filesystem; used without care it can erase days of work in seconds, and used thoughtfully it keeps projects tidy and safe. A practical cleanup Imagine clearing stray files in a project directory; do this live and learn: ``` $ ls project/ temp.txt old_build/ $ rm temp.txt $ ls project/ old_build/ $ rm -r old_build $ ls project/ ``` Options that matter Use `-i` to prompt before each removal, `-I` to prompt once for many files, `-r` or `-R` to remove directories recursively, `-f` to force without prompts, and `-v` to show actions; note GNU coreutils refuses `rm -rf /` by default via "--preserve-root" and you must explicitly pass "--no-preserve-root" to override that protection. Tools to combine Pair `rm` with `find` and `xargs` to remove large sets precisely, prefer `trash-cli` or desktop trash for reversible deletes, and use `shred` or `wipe` when you need to make recovery harder; for example `find . -type f -name '*.tmp' -print0 | xargs -0 rm -v`. Finish and next steps Practice on disposable files and directories until the options become second nature, then learn secure-delete and recovery limits to understand what deletion really means; for deep exam-focused study consider pursuing CompTIA Linux+ or LPIC-1 preparation with intensive courses at bitsandbytes.academy to turn these skills into certification. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities security backup scripting troubleshooting