Part 1 of 6 · 1 min read
Why this page comes first
In this module you will
- Pick the command that answers a question about a process, memory, files, disks or the machine as a whole.
- Read
pscolumns such asVSZ,RSS,NLWPandSTAT, and link each to a concept from earlier levels. - List the open files and mappings of a process with
/proc,lsofandpmap. - Tell virtual size from resident size on a running program.
- Use a short routine of questions before commands when a machine misbehaves.
Levels 0 to 11 gave the ideas: processes, threads, scheduling, locks, memory, disks, file systems, protection and containers. This level turns the ideas into daily work, and this page starts with the tools that show them. Every column in the output below was explained in an earlier level, and the table in section 1 says which. Pages 2 to 5 then go deeper into /proc, system-call tracing, performance work and crashes, and page 6 closes with interview practice.
About this example About this example
Real: Every command and output on this page was run on a Linux test machine (kernel 6.18, 2 processors, 8 GiB, no swap). The worker program was compiled with gcc -Wall -Wextra -pthread.
Scripted: The worker program is made up to give a process with known facts: it asks for 100 MiB, writes to 30 MiB, opens two files and starts two threads. The questions in section 1 are the author's own list.
Not real: The test machine is nearly idle, so its load numbers are zero, and a busy server would show other values. Output columns can differ a little between versions of ps and lsof.