BM: Baca dalam Bahasa Melayu
World L1: The Shophouse
Find files with find
You will learn: to make the server search every room for a file by name or kind.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
Mak’s secret sambal recipe is lost in the store room. It sits in a box, inside a box. Do you open every room with cd and ls?
Pick one answer.
Watch
You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
- kedai/ (folder)
drwxrwxr-xcounter kitchen menu store
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
find walks through kedai and every room inside it. -name sambal.txt keeps only that name. It prints the path of each match.
Predict
Mak named her file Sambal-Mak.txt. Does find kedai -name "sambal*" find it?
Pick one answer.
Try it
Find every sambal recipe, big letters or small: find kedai -iname "sambal*".
You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
- kedai/ (folder)
drwxrwxr-xcounter kitchen menu store
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
The* means “anything after”. Keep the quotes.Check
find can test more than names. Which test fits each search?
Drag a card into a box. Or tap the card, then tap the box.
Try it
Find every log file in the shop: find kedai -name "*.log".
You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
- kedai/ (folder)
drwxrwxr-xcounter kitchen menu store
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
Quotes around"*.log" let find see the star.Check
Build a search for empty folders, so you can tidy them later.
Tap the pieces in the right order.
You did it!
You can now find files by name, kind or emptiness.
Go deeper (optional)
Search from / and you see lines like find: ‘/root’: Permission denied. Plain words: rooms you have no key for. World L2 explains keys. -delete and -exec act on every match: run the search alone first.
Real rep (optional): on Linux, find /etc -name "*.conf" lists settings files. Ignore the Permission denied lines.
Bahasa Melayu
Resepi sambal rahsia Mak hilang dalam bilik stor. Ia ada dalam kotak, di dalam kotak lagi. Perlukah anda buka setiap bilik dengan cd dan ls?
find berjalan dalam kedai dan setiap bilik di dalamnya. -name sambal.txt simpan nama itu sahaja. Ia cetak path setiap padanan.
Mak namakan failnya Sambal-Mak.txt. Adakah find kedai -name "sambal*" jumpa fail itu?
Cari setiap resepi sambal, huruf besar atau kecil: find kedai -iname "sambal*".
* maksudnya “apa saja selepas ini”. Kekalkan tanda petik.find boleh uji lebih daripada nama. Ujian mana sesuai untuk setiap carian?
Cari setiap fail log dalam kedai: find kedai -name "*.log".
"*.log" biar find nampak bintang itu.Bina carian untuk folder kosong, supaya anda boleh kemaskan nanti.
Kini anda boleh cari fail ikut nama, jenis atau kosong.
You finished this before. Practice is always welcome!
Official docs: find (Debian 13 man page) · GNU findutils manual
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?