BM: Baca dalam Bahasa Melayu
World L2: Keys & Staff
Processes: ps and top
You will learn: to see every program at work on the server and spot the one hogging the CPU.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
The server feels slow. Customers wait 10 seconds for the menu page. What do you check first?
Pick one answer.
Watch
You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
- bin/ (folder)
drwxrwxr-xstock-check.sh
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Busy programs
1241bash /home/you/bin/stock-check.shusing the CPU
Every program at work is a process: A program at work right now, like a cook on shift. Each one has a number, its PID., like a cook on shift. ps aux lists them all. Each has a staff number: its PID.
Check
Tap the process that eats the CPU. Look at the %CPU column.
0 of 1 found
Try it
top shows the same, live, busiest first. Run top, look at the top row, then press q.
You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
- bin/ (folder)
drwxrwxr-xstock-check.sh
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Busy programs
1241bash /home/you/bin/stock-check.shusing the CPU
Hint
top holds the terminal until you press q.Check
Which column tells you what?
Drag a card into a box. Or tap the card, then tap the box.
Try it
Long lists are tiring. Ask for the PID by name: pgrep -f stock-check.
You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
- bin/ (folder)
drwxrwxr-xstock-check.sh
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Busy programs
1241bash /home/you/bin/stock-check.shusing the CPU
Hint
-f searches the whole command line, not just the program name.Predict
You type plain ps, with no aux. Do you see stock-check.sh?
Pick one answer.
You did it!
You can now list the server’s processes and find the one hogging the CPU.
Go deeper (optional)
In top, M sorts by memory and P by CPU. ps aux | grep nginx filters the list with a pipe. htop is a friendlier top: you install it in lesson 10.
Real rep (optional): on Linux, run top for ten seconds, then press q. Which process is busiest?
Bahasa Melayu
Server terasa perlahan. Pelanggan tunggu 10 saat untuk laman menu. Apa anda semak dulu?
Setiap program yang bekerja ialah process (proses), macam tukang masak yang bertugas. ps aux senaraikan semuanya. Setiap satu ada nombor pekerja: PID.
top tunjuk perkara sama, secara langsung, yang paling sibuk di atas. Jalankan top, tengok baris teratas, kemudian tekan q.
top pegang terminal sehingga anda tekan q.Lajur mana beritahu apa?
Senarai panjang memenatkan. Minta PID ikut nama: pgrep -f stock-check.
-f cari dalam seluruh baris arahan, bukan nama program sahaja.Anda taip ps sahaja, tanpa aux. Adakah anda nampak stock-check.sh?
Kini anda boleh senaraikan proses server dan cari yang membolot CPU.
You finished this before. Practice is always welcome!
Official docs: ps (Debian 13 man page) · top (Debian 13 man page) · pgrep (Debian 13 man page)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?