BM: Baca dalam Bahasa Melayu
World L1: The Shophouse
Search inside files: grep
You will learn: to pull out only the lines you need from a long file.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
The boss asks: which tables have not paid? The order book has 15 lines today. Tomorrow it may have 900.
Pick one answer.
Watch
You are you in /home/you/kedai/counter. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/kedai/counter$Folder ~/kedai/counter
- orders.log (file)
-rw-r--r--
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
grep prints only the lines that contain your word. Two tables have not paid: T5 and T6. Or is that all?
Predict
One cashier wrote Unpaid, not UNPAID. Did grep show that line?
Pick one answer.
Try it
Catch every spelling: grep -i unpaid orders.log.
You are you in /home/you/kedai/counter. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/kedai/counter$Folder ~/kedai/counter
- orders.log (file)
-rw-r--r--
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
-i means “ignore case”.Check
Tap every line that grep T6 orders.log prints.
0 of 2 found
Check
Three handy switches. Which one answers each question?
Drag a card into a box. Or tap the card, then tap the box.
Try it
How many nasi lemak orders today? Ask grep to count: grep -c nasi-lemak orders.log.
You are you in /home/you/kedai/counter. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/kedai/counter$Folder ~/kedai/counter
- orders.log (file)
-rw-r--r--
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
-c means “count”.You did it!
You can now pull just the lines you need from a file.
Go deeper (optional)
grep laksa orders.log prints nothing and ends with exit code 1. Plain words: no line matched; nothing broke. grep -r belacan ~/kedai searches every file in every room. grep -n and -i mix: grep -ni unpaid orders.log.
Real rep (optional): on Linux, grep -c bash /etc/passwd counts users with bash as their shell.
Bahasa Melayu
Bos tanya: meja mana yang belum bayar? Buku pesanan ada 15 baris hari ini. Esok mungkin 900.
grep cetak baris yang ada perkataan anda sahaja. Dua meja belum bayar: T5 dan T6. Atau itu sahaja?
Seorang juruwang tulis Unpaid, bukan UNPAID. Adakah grep tunjuk baris itu?
Tangkap semua ejaan: grep -i unpaid orders.log.
-i maksudnya “ignore case” (abaikan huruf besar kecil).Tiga suis berguna. Yang mana jawab setiap soalan?
Berapa pesanan nasi lemak hari ini? Suruh grep kira: grep -c nasi-lemak orders.log.
-c maksudnya “count” (kira).Kini anda boleh tarik baris yang anda perlu sahaja daripada fail panjang.
You finished this before. Practice is always welcome!
Official docs: grep (Debian 13 man page) · GNU grep manual
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?