Process Monitoring Commands
Duration: 8 min
This video lesson is available to enrolled students.
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This lecture introduces Linux process monitoring commands, focusing on mpstat, pidof, pmap, ps, and top. The instructor uses a slide titled “Process Monitoring Commands” with a table listing each command, its purpose, and example terminal output. mpstat is shown reporting CPU utilization on a multiprocessor system using “mpstat 2 3,” with output columns such as %usr, %nice, %sys, %iowait, %irq, and %idle. pidof is demonstrated by “pidof nginx” returning PIDs 2456, 24157, and 2458, while “pidof sshd” returns 1120. pmap is shown with “pmap 2456,” displaying the memory map of an nginx master process, including Address, Kbytes, RSS, Dirty Mode, and Mapping columns. The lesson then transitions to ps and top: “ps -ef | head -5” provides a static snapshot of current processes, while “top” shows real-time interactive monitoring with load average, task counts, CPU/memory lines, and a live process table. The key distinction emphasized is that ps captures one-time process state, whereas top continuously updates process information.
Chapters
0:00 – 2:00 00:00-02:00
The opening slide presents a table of process monitoring commands with columns “Command,” “What it Does,” and “Example (with Output).” The first rows cover mpstat, pidof, and pmap. On-screen terminal examples include “mpstat 2 3” with CPU columns such as %usr, %nice, %sys, %iowait, %irq, and %idle; “pidof nginx” returning “2456 24157 2458”; and “pmap 2456” showing an nginx process memory map.
2:00 – 5:00 02:00-05:00
The instructor continues explaining the same command table, using red annotations to highlight important output details. A red box marks “(4 CPU)” in the mpstat header, a red underline and arrow point to “pidof nginx,” and a red circle surrounds the returned PIDs. The slide text defines mpstat as reporting CPU utilization on a multiprocessor system, pidof as returning the PID of a running process by name, and pmap as displaying the memory map of a process.
5:00 – 7:45 05:00-07:45
The slide shifts to the ps and top commands. The example “ps -ef | head -5” lists processes such as systemd, kthreadd, rcu_gp, and nginx, while the “top” example shows load average, “Tasks: 189 total,” CPU and memory lines, and a process table including nginx and sshd. A bottom note states that ps provides a static snapshot of processes, while top provides real-time interactive process monitoring.
The lecture builds a practical overview of Linux process monitoring by pairing command definitions with concrete terminal output. The first part emphasizes system-level and per-process inspection: mpstat for CPU utilization, pidof for finding process IDs by name, and pmap for examining a process’s memory map. The second part contrasts two core monitoring tools: ps, which gives a static snapshot of current processes, and top, which provides continuous real-time monitoring. For exam revision, students should remember that mpstat reports multiprocessor CPU statistics; pidof maps process names to PIDs; pmap shows memory mappings for a given PID; ps -ef lists current processes in full format; and top is interactive, displaying live load average, task counts, CPU/memory usage, and per-process activity. The central teaching point is choosing the right tool: use ps for a one-time snapshot and top when ongoing, real-time process monitoring is needed.