BM: Baca dalam Bahasa Melayu
World L1: The Shophouse
Delete with care: rm has no undo
You will learn: to delete files and folders safely, because there is no bin.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
On your laptop, deleted files wait in a bin. On a Linux server, where does rm send them?
Pick one answer.
Watch
You are you in /home/you/kedai. 6 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/kedai$Folder ~/kedai
- b.tmp (file)
-rw-r--r-- - counter/ (folder)
drwxrwxr-xorders.log - kitchen/ (folder)
drwxrwxr-xrendang.txt sambal.txt - menu/ (folder)
drwxrwxr-xdrinks.txt today.txt - old/ (folder)
drwxrwxr-xmenu-2025.txt prices-2025.txt - store/ (folder)
drwxrwxr-xstock.txt
+ 1 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
rm a.tmp deleted the file. No question, no bin. rm means “remove”. Try rm b.tmp: a Careful note appears.
Predict
old is a folder full of old menus. You type rm old. What does the server say?
Pick one answer.
Try it
Delete the two empty temp files, a.tmp and b.tmp. Keep everything else.
You are you in /home/you/kedai. 7 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/kedai$Folder ~/kedai
- a.tmp (file)
-rw-r--r-- - b.tmp (file)
-rw-r--r-- - counter/ (folder)
drwxrwxr-xorders.log - kitchen/ (folder)
drwxrwxr-xrendang.txt sambal.txt - menu/ (folder)
drwxrwxr-xdrinks.txt today.txt - old/ (folder)
drwxrwxr-xmenu-2025.txt prices-2025.txt - store/ (folder)
drwxrwxr-xstock.txt
+ 1 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
rm takes several names: rm a.tmp b.tmp.Check
Safe habit, or risky?
Swipe right for good, left for needs work. Or use the buttons.
Run ls first. Then rm exactly what you saw.
Try it
The 2025 menus are not needed. Delete the old folder and everything inside: rm -r old.
You are you in /home/you/kedai. 7 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/kedai$Folder ~/kedai
- a.tmp (file)
-rw-r--r-- - b.tmp (file)
-rw-r--r-- - counter/ (folder)
drwxrwxr-xorders.log - kitchen/ (folder)
drwxrwxr-xrendang.txt sambal.txt - menu/ (folder)
drwxrwxr-xdrinks.txt today.txt - old/ (folder)
drwxrwxr-xmenu-2025.txt prices-2025.txt - store/ (folder)
drwxrwxr-xstock.txt
+ 1 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
-r means “the folder and everything inside it”.Check
Put the safe delete routine in order.
First step at the top. Put these in order. Use the arrows, or drag.
- pwd: am I in the right room?
- rm -r old: delete it
- ls: check it is gone
- ls old: what is inside?
- cp -r old ~/old-backup: only if unsure
You did it!
You can now delete files and folders, carefully, with no undo.
Go deeper (optional)
rmdir old deletes a folder only when it is empty: a gentle choice. rm -i asks before each file on a real machine. -f never asks and hides errors, so treat it like a sharp knife.
Real rep (optional), in a practice folder:
Real mission
mkdir -p trash-test && touch trash-test/a.tmp trash-test/b.tmprm -i trash-test/a.tmpls trash-testrm -r trash-test
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Di laptop anda, fail yang dipadam menunggu dalam tong sampah. Di server Linux, ke mana rm hantar fail?
rm a.tmp sudah padam fail itu. Tiada soalan, tiada tong sampah. rm maksudnya “remove” (buang). Cuba rm b.tmp: nota Hati-hati akan muncul.
old ialah folder penuh menu lama. Anda taip rm old. Apa server kata?
Padam dua fail sementara yang kosong, a.tmp dan b.tmp. Simpan yang lain.
rm boleh terima beberapa nama: rm a.tmp b.tmp.Tabiat selamat, atau berisiko?
Menu 2025 sudah tak perlu. Padam folder old dan semua isinya: rm -r old.
-r maksudnya “folder ini dan semua isinya”.Susun rutin padam yang selamat.
Kini anda boleh padam fail dan folder dengan cermat, tanpa undo.
You finished this before. Practice is always welcome!
Official docs: rm (Debian 13 man page) · rmdir (Debian 13 man page) · GNU coreutils: rm invocation
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?