Inspect the kernel through /proc
The /proc filesystem is the Linux kernel’s window into itself. Instead of a
system call, you read a file: cat /proc/meminfo for memory, cat /proc/loadavg
for load, or cat /proc/PID/status for one process. This tool is a searchable
map of the most useful entries, split between system-wide files and the
per-process files under /proc/PID/, with the exact data format you will see.
How it works
/proc is a virtual filesystem mounted at boot. The files do not exist on disk —
the kernel synthesises their contents the moment you open them, which is why they
report a size of zero yet return live data. System-wide entries live directly
under /proc (for example /proc/cpuinfo), while each running process gets a
numbered directory whose name is its PID. A process can always reach its own
directory through the /proc/self symlink. Many tools you already use are thin
readers over /proc: top and ps parse /proc/PID/stat, free parses
/proc/meminfo, and lsof walks /proc/PID/fd/.
Tips and notes
Fields differ slightly by kernel version and architecture, so use these format
notes as a guide and confirm with man 5 proc. Remember that values containing
embedded NUL bytes — cmdline and environ — look run-together under cat;
translate the NULs to spaces or newlines to read them. Entries under
/proc/sys/ mirror sysctl, and writing to those leaf files changes the live
setting, so treat that tree as configuration rather than read-only data.