Delete a file
Remove files with rm
⏱ Est. ~5 min
01 · Read
If you can create, you can also delete. Sometimes you need to clean up. The rm command permanently deletes a file — no trash, no undo.
💡 Picture thisUnlike dragging to the trash, rm is more like running a document through a shredder. Deleted means gone.
Key points
- rm is short for remove
- Deleted files don't go to the trash — they're gone for good
- Always double-check before using rm
02 · Terminal exercise
Sometimes you need to clean up. Let's delete some files we don't need.
(This section is interactive — please enable JavaScript.)
03 · Terminal exercise
Delete the temp file.
(This section is interactive — please enable JavaScript.)
04 · Quiz
Can a file deleted with rm be recovered?
- No — it's permanently deleted
- Yes, check the trash
- Yes, with rm --undo
- Only an admin can recover it
05 · Terminal exercise
Clear out the old notes too.
(This section is interactive — please enable JavaScript.)
06 · Terminal exercise
Confirm the cleanup.
(This section is interactive — please enable JavaScript.)
07 · Quiz
What do you have to watch out for with rm?
- It's slow on large files
- Deleted files don't go to the trash — they're gone forever
- It only works on empty files
- You need admin permissions to use it
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.