Kolam Ayer MakersLinux Foundations

CPU

Core Idea

The CPU is the hardware that executes program instructions.

The CPU executes instructions for running processes. The kernel schedules which process gets CPU time and for how long.

Commands To Try

uptime
ps aux --sort=-%cpu | head
htop

uptime shows load average. ps can show processes using CPU. htop shows an interactive view.

Load Average

Load average is a rough count of runnable or waiting work over time windows. It is not the same as percentage CPU, and it only makes sense relative to CPU count and workload.

Processes And Scheduling

Many processes appear to run at once. The kernel scheduler gives them turns on CPU cores. A stuck or busy process may consume CPU time even if it prints nothing.

Common Confusions

Proof Check

Run ps aux --sort=-%cpu | head and identify the command using the most CPU at that moment.

Docs Pointers