Skip to main content
Module 2 · Lesson 3 of 35/11 in the course~15 min
Module lessons (3/3)

Deleting resources (rm)

Lesson preview5 hands-on exercises readyLinux Terminal · Module 2 — Files and Folders

Remove files and entire folders recursively (-r) and forcefully (-f) using rm.

What you'll learn in this lesson

  • Delete single files or multiple files at once using rm (Remove).
  • Remove folders with their entire subtree via the -r recursive option and understand the effect of -f (force).
  • Apply rigorous preventative checks before executing destructive commands, knowing that the terminal does not use the recycle bin.

Overview

In the Linux terminal, the rm (Remove) command is immediate and definitive: it does not move the items to the desktop trash, but immediately detaches the file or folder from the file system. Using it methodically and preventively is a critical skill for working in production.

You can list multiple names separated by space (or in real shell use checked patterns after testing them with echo/ls):

Sections covered in this lesson

  1. 1Variants of rm and behavior on the VFS
  2. 2Progressive examples
  3. 3Practical exercises
  4. 4Quick check
Pro Lesson · Module 2 — Files and Folders

Unlock "Deleting resources (rm)" and the full Linux Terminal curriculum

Remove files and entire folders recursively (-r) and forcefully (-f) using rm.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Linux Terminal plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.